JDBC Connection Issues with MySQL
807606Feb 25 2007 — edited Feb 25 2007Afternoon everyone!
Newbie programmer here... I'm having an issue connecting to my mySQL driver. The following code...
package xpcmanagementapplication;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class Connect {
public static void main(String args[]) {
Connection con = null;
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch(Exception e) {
System.err.println("Exception: " + e.getMessage());
} finally {
try {
if(con != null)
con.close();
} catch(SQLException e) {}
}
}
}
Gives me...
init:
deps-jar:
Compiling 1 source file to C:\Documents and Settings\SeanKSmith\HeadFirstJava\Chapter1\XPCManagementApplication\build\classes
compile:
run:
Exception: com.mysql.jdbc.Driver
BUILD SUCCESSFUL (total time: 0 seconds)
Do I have something setup wrong with my java environment? Any help would be greatly appreciated. Thanks!