Hi;
I'm using Connector/J, but I'm unable to solve o problem. I hae the following
Java code (taken from these web pages):
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class BD {
public static void main(String args[]) throws Exception {
Connection con = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con =
DriverManager.getConnection("jdbc:mysql://localhost:3306/test?user=root&password=pujols");
}
catch(SQLException ex){
System.out.println("SQLException: "+ex.getMessage());
System.out.println("SQLState: "+ex.getSQLState());
System.out.println("VendorError: "+ex.getErrorCode());
}
}
}
However, when I try to execute this file, I get a message error saying that it's
impossible to find the com.mysql.jdbc.Driver (ClassNotFoundException). I have
modified the Path of my system to include the jar file I found in the
Connector/J Zip (I think I did it correctly...). In case to delete this
sentence, I get a SQLException: not suitable driver.
What Am I doing bad? Where is the class I need? I haven't been able to find any
solution anywhere.
Thanks for all.
Sergi