Reputation: 5
public static boolean startDriver(){
try{
Class.forName("com.mydql.jdbc.Driver");
System.out.println("Loaded MySQL driver!");
}catch(ClassNotFoundException e){
System.out.println("Failed to start MySQL driver! JDBC not found!");
return false;
}
return true;
}
I'm trying to use JDBC with my Java project but I keep receiving a ClassNotFoundException. I have referenced the mysql_connector.jar that I downloaded from the MySQL website and tried everything! It's in my >Referenced Libraries folder but I still keep getting the error!
Upvotes: 0
Views: 84
Reputation: 12776
Class.forName("com.my**d**ql.jdbc.Driver");
Ought to be
Class.forName("com.mysql.jdbc.Driver");
Upvotes: 4