Reputation: 3
public void connect()
{
try
{
Class.forName("com.mysql.jdbc.Driver").newInstance();
String url = "jdbc:msql://23.249.225.135:3306/";
Connection conn = DriverManager.getConnection(url,"s****d","1*****-");
System.out.println("DB works");
}
catch (Exception e)
{
System.err.println("Got an exception! ");
System.err.println(e.getMessage());
}
}
I have the JDBC driver in the /lib folder in my class path. Keep getting:
No suitable driver found for jdbc:msql://23.249.225.135:3306/
Any ideas?
Upvotes: 0
Views: 36
Reputation: 23361
The version of your mysql database doesn't support the version of your driver or vice-versa.
Look for the compatibility matrix here: Chapter 2 Connector/J Versions
Upvotes: 0