Hi everyone,
I'm having some problems with
JDBC and connecting to a mysql database on a Linux machine. I've downloaded the drivers (MySQL Connector-J) and have the jar file in my jre/lib/ext directory. Everytime I try and run it I get the following error:
Error with sql java.sql.SQLException: Driver not found for URL: jdbc:mysql://localhost/sw4
Here is the code in question.
String connectionURL = "jdbc:mysql://localhost/JobDB";
Connection con = null;
PreparedStatement ps = null;
ResultSet rs = null;
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
con = DriverManager.getConnection(connectionURL, "username", "password") ;
ps = con.prepareStatement("SELECT clientID FROM clients");
rs = ps.executeQuery();
Something in the DriverManager is causing me too much grief.
Thanks in advance.