This looks like a repeat of a previous thread, but I still haven't cracked it.
I'm doing everything on a single Windows XP pc, so no servers or clever stuff involved.
I blew the space on MS Access so I'm attempting to return to plan A of using MySQL.
Installed:-
Java DB 10.5.3.0
Java SE development Kit 6
Java Runtime Environment 6
JCreatorLE 3.10
MySQL Server 5.1
MySQL Workbench 5.1 OSS
MySQL Workbench 5.2 CE
I put mysql-connector-java-5.1.13-bin.jar in C:\Program Files\Java\jre6\lib\ext
I put "CLASSPATH .;C:\Program Files\Java\jre6\lib\ext\mysql-connector-java-5.1.13-bin.jar" in system variables.
My source includes:
import java.sql.*;
try
{
Class.forName ("com.mysql.jdbc.Driver").newInstance ();
}
catch (Exception e)
{
System.err.println (e + " Cannot get driver");
return;
}
try
{
System.out.println("MySQL JDBC driver loaded ok.");
String url = "jdbc:mysql://127.0.0.1:3306/pafdb?user=root&password=root";
PAFConn = DriverManager.getConnection (url);
System.out.println ("Database connection established");
}
catch (Exception e)
{
System.err.println (e + "Cannot connect to database server");
}
The code may be a bit flaky, but I'm brand new to this.
The log says
"java.lang.ClassNotFoundException: com.mysql.jdbc.Driver Cannot get driver"
so we fell down at the first hurdle.
I thought I'd followed all the on-line advice I could find, but still I'm not getting through. I was fine(ish) before with MS Access, so clearly I've missed something on MySQL.
All suggestions gratefully received. I'm flummoxed!