I have added the JDBC connector to my class path but I still receive "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver" error message. Is there a fault with my code I am not seeing?
import java.sql.Connection;
import java.sql.DriverManager;
public class DBConnect {
public static Connection conn = null;
public static Connection ConnectDB () {
try {
Class.forName("com.mysql.jdbc.Driver");
conn =
DriverManager.getConnection("jdbc:mysql://localhost/destore",
"root", "1234");
return conn;
}catch(Exception e) {
javax.swing.JOptionPane.showMessageDialog(null, e);
return null;
}
}
}