MySQL connection problem

I'm using NetBean IDE 5.5 and and I want to connect to MySQL database at my computer but it can't get connected

I already download the MySql connector from MySql web and it still cant proceed. Could someone show me how to do it properly, thank you in advance

the code:

String url = "jdbc:mysql://localhost:3306/abcd_ss";

String username = "unite";

String password = "unite";

Connection connection;

try{

Class.forName("com.mysql.jdbc.Driver");

connection = DriverManager.getConnection(url, username, password );

}

catch ( ClassNotFoundException cnfex ) {

System.err.println(

"Failed to load JDBC/ODBC driver." );

cnfex.printStackTrace();

// System.exit( 1 ); // terminate program

}

catch ( SQLException sqlex ) {

System.err.println( "Unable to connect" );

sqlex.printStackTrace();

}

the error :

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

[993 byte] By [modjojoa] at [2007-11-27 7:48:25]
# 1
you should add that jdbc driver to your class path.in netbeans, you can add to your project library:>Projects (usually on left pane) >YourProjectName> Libraries> Add JAR/Folders
j_shadinataa at 2007-7-12 19:29:16 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Add the JDBC JAR file to classpath. http://www.netbeans.org/kb/41/using-netbeans/project_setup.html#manageclasspath
dvohra09a at 2007-7-12 19:29:16 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
Thanks to all, it had solve the problem
modjojoa at 2007-7-12 19:29:16 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...