The exception java.lang.classnotfoundexception com.mysql.jdbc.driver occurs in Eclipse project when there is not JDBC Driver class in the project.
If you are working on a project in Eclipse that connects to the MySQL database server and you are not able to execute the program due to the following exception:
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
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.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.devmanuals.BatchExample.main(BatchExample.java:20)
Then you can easily solve this exception by adding the MySQL JDBC driver file.
You have to download the JDBC driver file from http://dev.mysql.com/downloads/connector/j/
Check the video, which explains how to download the JDBC Driver file.
Now the following video explains you how to add the JDBC driver file into your Eclipse project to solve the java.lang.classnotfoundexception com.mysql.jdbc.driver exception in the Eclipse IDE:
At devmanuals.com you will find large number of Core and Advanced Java programming tutorials. Now you can check our Core and Advanced Java programming section for more tutorials on Java language.
[ 0 ] Comments