470,591 Members | 1,491 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,591 developers. It's quick & easy.

Problem with MySQL Connection/J

I try to install MySQL Connection/J on a Windows XP box. MySQL on
localhost works fine. But I cannot load the MySQL Connection/J Driver.
The CLASSPATH variable is set like this:
CLASSPATH=c:\j2sdk1.4.2_04\jre\lib\ext\mysql-connector-java-3.0.14-production-bin.jar
To test it I use this simple code (just to test if the Driver is loaded):
//------------------------------------------------------------------
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class LoadDriverSimple {
public static void main(String[] args) {
Class.forName("com.mysql.jdbc.Driver").newInstance ();
}
}
//-------------------------------------------------------------------

The error messages are:
__________________________________________________ ____________________
C:\AllMyfiles\MyIT-Stuff\java\TNB\JDBC Client\LoadDriverSimple.java:7:
unreported exception java.lang.ClassNotFoundException; must be caught or
declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance ();
^
C:\AllMyfiles\MyIT-Stuff\java\TNB\JDBC Client\LoadDriverSimple.java:7:
unreported exception java.lang.InstantiationException; must be caught or
declared to be thrown
Class.forName("com.mysql.jdbc.Driver").newInstance ();
^
2 errors
__________________________________________________ _______________________

Due to ClassNotFoundExecption-error it cannot find the MySQL
Connection/J classe, why?

Thanks in advance
Peter
Jul 20 '05 #1
0 1775

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by sridhar nagabhurshana | last post: by
1 post views Thread by Chinmay Shah | last post: by
6 posts views Thread by Ian Davies | last post: by
1 post views Thread by James | last post: by
reply views Thread by Daniel Crespo | last post: by
1 post views Thread by erikcw | last post: by
10 posts views Thread by sssk28 | last post: by
2 posts views Thread by dmstn | last post: by
1 post views Thread by manjava | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.