jQuery in Action, 3rd edition
The moose likes JDBC and Relational Databases and the fly likes JDBC MySql Driver problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "JDBC MySql Driver problem" Watch "JDBC MySql Driver problem" New topic

JDBC MySql Driver problem

zack chancery
Ranch Hand

Joined: Aug 19, 2004
Posts: 33
Please help,
I downloaded a mySql Driver that comes in the form of a jar file called mysql-connector-java-3.0.15-ga.jar. i saved it in the jre/lib/ext dir of my j2sdk as is advised but when i try and load it in my program i get an exception. when i print the stackTrace for the exception this is returned:

java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:162)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at sun.applet.AppletClassLoader.loadClass(AppletClassLoader.java:123)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at Teller.<init>(Teller.java:53)
at Main.init(Main.java:20)
at sun.applet.AppletPanel.run(AppletPanel.java:353)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.io.FileNotFoundException: H:\project\com\mysql\jdbc\Driver.class
(The system cannot find the path specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at java.io.FileInputStream.<init>(FileInputStream.java:66)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
at sun.applet.AppletClassLoader.getBytes(AppletClassLoader.java:274)
at sun.applet.AppletClassLoader.access$100(AppletClassLoader.java:43)
at sun.applet.AppletClassLoader$1.run(AppletClassLoader.java:152)
at java.security.AccessController.doPrivileged(Native Method)
at sun.applet.AppletClassLoader.findClass(AppletClassLoader.java:149)

David Ulicny
Ranch Hand

Joined: Aug 04, 2004
Posts: 724
Maybe is problem in applet security.

What mean this part of your stack trace?

Caused by: java.io.FileNotFoundException: H:\project\com\mysql\jdbc\Driver.class
(The system cannot find the path specified)

SCJP<br />SCWCD <br />ICSD(286)<br />MCP 70-216
sai Narayan

Joined: Aug 16, 2004
Posts: 21
try setting the classpath as:-
C:\> set CLASSPATH=\path\to\mysql-connector-java-[version]-bin.jar;%CLASSPATH%
I agree. Here's the link: http://aspose.com/file-tools
subject: JDBC MySql Driver problem
jQuery in Action, 3rd edition