hi all,
I have tried using this code to access a mysql database but alas i get an error 'Exception in
thread "main" java.sql.SQLException: No sutible driver'
but I installed the driver from 'http://mmmysql.sourceforge.net/' and set the CLASSPATH up correctly!?
Here is the code
--------------------------------------------------------
import java.sql.*;
public class Connect{
public static void main(
String args[]) throws Exception{
Connection con = null;
try{
String url = "jdbc://hostname:3306/database";
Class.forName("org.gjt.mm.mysql.Driver");
con = DriverManager.getConnection(url, "uname", "pwd");
if(con != null){
System.out.println("whehe");
}
}
finally{
if(con != null){
try{
con.close();
}catch(Exception e){
System.out.println(e.getMessage());
}
}
}
}
}