No suitable driver found for jdbc:mysql://localhost/

拜拜、爱过 提交于 2019-12-01 08:04:40

The JAVA JDK does not come with specific SQL drivers(i.e mySQL, postgre, MS SQL, etc). You need to download and install them separately. The download link for the java mysql connector can be found here:

http://dev.mysql.com/downloads/connector/j/

It says to put the driver in your class path, but you can also put it in your IDE's build path, it might be easier depending on what you are doing.

Make sure the mysql jdbc connector is in the CLASSPATH. You probably also need to load the driver, adding the following line before trying to get the connection:

Class.forName("com.mysql.jdbc.Driver");

You need to have you mysql jdbc connector jar on the classpath for your mac.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!