I have done a few apps now that talk to MySQL and this one is giving me a pain. I load the driver fine with this code:
// load driver
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
}
catch(Exception ex)
{
JOptionPane.showMessageDialog(home,
"Drivers could not load",
"Driver Error",
JOptionPane.ERROR_MESSAGE);
}
and then when I try to get the connection I get a No Suitable Driver error. This is code (minus username and pass):
// connect
try
{
Connection conn=DriverManager.getConnection(
"jdbc:mysql://db.piratehook.com","*****","********");
// Do something with the Connection
}
catch(SQLException ex)
{
JOptionPane.showMessageDialog(home,
"SQLException: "+ex.getMessage()+"\n"+
"SQLState: "+ex.getSQLState()+"\n"+
"VendorError: "+ex.getErrorCode(),
"SQL Error",
JOptionPane.ERROR_MESSAGE);
}
any ideas?
Thx,
Duck Man