当前位置:Gxlcms > 数据库问题 > 出现java.sql.SQLException: No suitable driver的几种解决办法

出现java.sql.SQLException: No suitable driver的几种解决办法

时间:2021-07-01 10:21:17 帮助过:634人阅读

八月 19, 2017 8:30:46 下午 com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask run
警告: com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask@2b8dab95 -- Acquisition Attempt Failed!!! Clearing pending acquires. While trying to acquire a needed new resource, we failed to succeed more than the maximum number of allowed acquisition attempts (30). Last acquisition attempt exception:
java.sql.SQLException: No suitable driver
 at java.sql.DriverManager.getDriver(Unknown Source)
 at com.mchange.v2.c3p0.DriverManagerDataSource.driver(DriverManagerDataSource.java:223)
 at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
 at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
 at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
 at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
 at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
 at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
 at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
 at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)

1.:(1)很有可能c3p0-config.xml中的配置文件出现问题

这些配置一定要配置正确,像  第一个图片就忘记了一个“冒号“

技术分享

技术分享

2) 将Jar包放入Java lib目录

在JAVA_HOME目录下的jre\lib\ext文件下(如E:\jdk8\jre\lib\ext)放置一个连接MySQL数据库的jar包mysql- connector-java-****-bin.jar

3)Jar 包没有加入到Buildpath

看jar包是否在Referenced Libraries 里

技术分享

 

出现java.sql.SQLException: No suitable driver的几种解决办法

标签:解决办法   manage   number   lex   uil   strong   exce   没有   com   

人气教程排行