Hondjie RSA
Hondjie RSA

Reputation: 3

No suitable Driver error

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

Answers (2)

Titus
Titus

Reputation: 22474

You've misspelled mysql in the url is msql.

Upvotes: 2

Jorge Campos
Jorge Campos

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

enter image description here

Upvotes: 0

Related Questions