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());
}
}
我的类路径中的/lib 文件夹中有 JDBC 驱动程序。 继续获取:
No suitable driver found for jdbc:msql://23.249.225.135:3306/
有什么想法吗?
最佳答案
您将网址中的 mysql
拼错为 msql
。
关于java - 没有合适的驱动程序错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28002132/