验证Dao说连接数据库失败

来源:2-6 逐层完成SSM的各项配置

慕姐9476746

2020-04-21

Caused by: org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

The error may exist in file [C:\Users\ASUS\Desktop\o2o\target\classes\mapper\AreaDao.xml]

The error may involve com.imooc.o2o.dao.AreaDao.queryArea

The error occurred while executing a query

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Connections could not be acquired from the underlying database!

老师验证Dao时候报这个错误

写回答

2回答

翔仔

2020-04-22

同学好 请问同学的mysql版本是不是8 如果是 请按照 

http://coding.imooc.com/lesson/144.html#mid=26875

进行配置

1
3
Cris_hu
回复
翔仔
我也遇到了和题主一样的问题,解决了,spring-dao配置出了问题
2020-08-19
共3条回复

Cris_hu

2020-08-19

我是重新找了和数据库配置相关的文件,最终在spring-dao下发现配置出了问题

0
0

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程