File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC MySql Driver problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC MySql Driver problem" Watch "JDBC MySql Driver problem" New topic
Author

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
.java:69)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLCon
nection.java:156)
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)


regards,
z
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
Greenhorn

Joined: Aug 16, 2004
Posts: 21
hi
try setting the classpath as:-
C:\> set CLASSPATH=\path\to\mysql-connector-java-[version]-bin.jar;%CLASSPATH%
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JDBC MySql Driver problem