This question already has an answer here:
- Connect Java to a MySQL database 13 answers
I am trying to create the run the following in java program, but i am getting this error.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1332) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1166) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source)
try {
Class.forName("com.mysql.jdbc.Driver");
} catch (ClassNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
in build path, i have added the mysql connector jar file