java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/database

报错信息:java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/database

报错截图:

No suitable driver found for jdbc

 

解决办法:是你的项目中没有加入mysql的驱动jar,maven的pom.xml添加依赖如下:

<dependency>
  <groupId>mysql</groupId>
  <artifactId>mysql-connector-java</artifactId>
  <version>8.0.12</version>
</dependency>
正在加载评论...