package main;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
/**
*
* @author Josphat computertechie
*/
public class Table
{
static PreparedStatement pre =null;
static Connection conn=null;
/**
* Connect to database
*/
public static Connection ConnectDb(){
try{Class.forName("com.mysql.jdbc.Driver");
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
conn = DriverManager.getConnection("jdbc:odbc:jos");
Connection conn =DriverManager.getConnection("jdbc:mysql://localhost:3306/jos", "root", "");
return conn;
}catch (Exception e) {
return null;
}
}
/**
*
* @return
* @throws Exception
*/
}
No comments:
Post a Comment
Found it interesting comment