Connectivity issue-MySQL and Java
There is a problem in JDBC connectivity.I have downloaded the JDBC
Connector/J for MySQL connectivity with java. I've changed the
CLASSPATH environment variable, made changes in the code and tried
and tested with several modifications. But it still doesn't work.
Here is the source code.
public class Check
public static void main(String args)
System.out.println("Database connection established");
System.out.println("Cannot connect to server");
System.out.println("Database connection terminated");
It compiles and displays "Cannot connect to database" when run on the
Here are some specifications:
(1) My JDK is in C:\ drive
(2) MySQL is in Program Files.
(3) The Connector/J is in C:\jdk1.6.0_16\jre\lib\ext
The ext folder has the mysql-connector-java-5.1.10-bin.jar file.
Hence the CLASSPATH environment variable includes :
Please help me with this so that I can move on...