0

I installed jdk 1.8 (64 bit) on Windows 10. I also installed MySQL workbench 6.3.

When I connect my Java application with a MySQL database, I am getting:

java.lang.Classnotfound exception: com.sql.jdbc.driver.

To get rid of this problem I already copied the MySQL java connector .jar file in C:\Program Files\Java\jre1.8.0_51\lib\ext folder.

Also I set the PATH in system variables by going into advanced environment settings panel.

Still getting same message when running my Java application.

rzo1
  • 5,561
  • 3
  • 25
  • 64
Vikas Rattan
  • 1
  • 1
  • 1
  • Did you [Google](https://www.google.co.in/?gfe_rd=cr&ei=g91rVtnuFqTv8wec_JiADg&gws_rd=ssl#q=java.lang.classnotfoundexception+com.mysql.jdbc.driver) for this? – SatyaTNV Dec 12 '15 at 08:41
  • See this post: http://stackoverflow.com/questions/17484764/java-lang-classnotfoundexception-com-mysql-jdbc-driver-in-eclipse – Yacino Dec 12 '15 at 08:42
  • 1
    Possible duplicate of http://stackoverflow.com/questions/2591505/java-lang-classnotfoundexception-com-mysql-jdbc-driver – Madushan Perera Dec 12 '15 at 08:44
  • It is `com.mysql.jdbc.Driver`; so **my**sql, not sql. And you should not put things in `lib\ext`; it is going to be removed in Java 9 anyway. – Mark Rotteveel Dec 12 '15 at 09:38
  • Possible duplicate of [com.mysql.jdbc.Driver not found with mysql connector in buildpath](https://stackoverflow.com/questions/12920265/com-mysql-jdbc-driver-not-found-with-mysql-connector-in-buildpath) – Yvonne Marggraf Nov 20 '17 at 09:22
  • Have a look at: [another StackOverFlow-question](https://stackoverflow.com/questions/12920265/com-mysql-jdbc-driver-not-found-with-mysql-connector-in-buildpath) – Yvonne Marggraf Nov 20 '17 at 09:22

1 Answers1

0

You need to check following things:
1. Unzip driver jar file and check "com.sql.jdbc.Driver" is available?
2. If not then you can download latest jar file from mysql web page.
3. In side "com.mysql.jdbc" package "Driver" class is there, so you can use "com.mysql.jdbc.Driver" driver.
4. If you run your application on cmd or linux terminal then set classpath for complie and run your application.
5. If you use any IDE then update your application build path with driver jar.