i don't know much about this thing...
Code:
import java.sql.*;
public class Java2MySQL{
public static void main(String[] args){
Connection conn=null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
conn=DriverManager.getConnection("jdbc:mysql:///mydb");
if(!conn.isClosed())
System.out.println("connected...");
}
catch(Exception e){
System.err.println("exception: "+e.getMessage());
}
finally{
try{
if(conn!=null) conn.close();
}
catch(SQLException e){}
}
}
}
and i put the mysq-connector-java-3.0.11-stable-bin.jar in the d:\j2sdk1.4.0\jre\lib\ext. where d:\j2sdk1.4.0 is the path i installed java.