java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
I am getting following exception while connecting to mysql. Please let me know where am I wrong? Thank in advance.
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at MySqlTest.main(MySqlTest.java:18)
Related Post
Comments
One Response to “java.lang.ClassNotFoundException: com.mysql.jdbc.Driver”
Leave a Reply
From the exception it seems that mysql-connector-java-5.0.6-bin.jar is not in the class path.
Make sure that jar is in class path. If you are inside tomcat then put this jar in bin folder.
You can also set path of this jar in CLASSPATH in environment variable. Hope this will resolve your problem.