整合SSM遇到的错误,数据库连接失败问题集合

Could not get JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

遇到上面错误当然是先找到数据库的配置文件了,如果你使用的是mysql新版本他的driver修改了新的 要改成

jdbc.driver=com.mysql.cj.jdbc.Driver

最后再检查一遍用户名和密码以及url 就可以运行看看结果了。

要是还出现这个错误,就检查下配置文件有没有空间,如果你是用的c3p0连接池就检查下你的写法有没有加上jdbc.xxx等其他参数,要是还不行你就检查下你spring配置数据源的时候user是不是写成了username,
要是还不行的话就把jar包版本改成5.0+,pom自己添加依赖即可,以上就是全部百度的方法了。



org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout() 错误解决

错误原因就是:mybatis和spring-mybatis版本不匹配
把版本号改成
3.4.1和1.3.1没有错误

Handler dispatch failed; nested exception is java.lang.AbstractMethodError: Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.isClosed()Z is abstract 错误解决

换个依赖

<!--c3p0数据源-->
<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>

 最后再来一张成功图

原文地址:https://www.cnblogs.com/c-c-c-c/p/10040045.html