By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,780 Members | 1,126 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,780 IT Pros & Developers. It's quick & easy.

Problem with MySQL Connection/J

P: n/a
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
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.