欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2024-03-14 17:02:04
...

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

问题描述:
在debug模式下出现的,没执行到close,修改错去后,又从头执行,获取连接报错

问题原因:

XXX registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.


XXX appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak.//未关闭连接  引起 内存泄漏

XXX is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation.

问题处理:
重启服务器

参考:

出现这样的情况,一般有四种原因: 

一:连接URL格式出现了问题(Connection conn=DriverManager.getConnection("jdbc:mysql://localhost:3306/XX","root","XXXX") 

二:驱动字符串出错(com.mysql.jdbc.Driver) 

三:Classpath中没有加入合适的mysql_jdbc驱动(驱动要和你的数据库版本一致) 

四:驱动jar包放的位置不对