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