File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver" Watch "java.lang.ClassNotFoundException: com.mysql.jdbc.Driver" New topic

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver

Bill Riedl

Joined: Sep 08, 2009
Posts: 4
I'm using NetBeans 6.7.1 and am trying to connect to a MySQL DB. Below is a snippet from my code(I cut out the actual connection parameters and placed their names in italics). I'm new to this and this is just a scratch method for me to play around. When I compile I receive an error stating that class "com.mysql.jdbc.Driver" cannot be found. a MySQL driver is packaged with NetBeans and this is the URL according to the documentation. Am I missing something?

Thanks for your help!

private void scratch() throws SQLException, ClassNotFoundException

Connection con = DriverManager.getConnection

satishbsk kumar

Joined: Jul 24, 2009
Posts: 15
place mysql-connector-java-*.bin.jar file in your class path
Bill Riedl

Joined: Sep 08, 2009
Posts: 4
Thanks Satishbsk now
I agree. Here's the link:
subject: java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
It's not a secret anymore!