According to what Sun says about jdbc4 in java 6, the line Class.forName("com.mysql.jdbc.Driver"); is not needed
But I can't make it to work, has anybody tested Connector/J 5.1.5 with Java 1.6 without it ?
String connectionString = "jdbc:mysql://localhost/db1";
String dbUser = "root";
String dbPassword = "password";
java.sql.Connection conn = DriverManager.getConnection(connectionString, dbUser, dbPassword);
The above code throws Exception No suitable driver found for jdbc:mysql://localhost/db1
I have the mysql-connector-java-5.1.5-bin.jar in Classpath beacuse when I uncomment the line Class.forName("com.mysql.jdbc.Driver"); everything works fine.