org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.Persiste
Spring-Mybatis整合问题描述:提示:在进行mybatis与Spring的整合过程中抛出了以下异常信息:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:### Error querying database.Ca
·
Spring-Mybatis整合
问题描述:
提示:在进行mybatis与Spring的整合过程中抛出了以下异常信息:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'æ´ªå¦æ·»'@'localhost' (using password: YES))
### The error may exist in com/ssm/mapper/UserMapper.xml
### The error may involve com.ssm.mapper.UserMapper.findUserById
### The error occurred while executing a query
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Cannot create PoolableConnectionFactory (Access denied for user 'æ´ªå¦æ·»'@'localhost' (using password: YES))
原因分析:
捕获到关键信息点:Failed to obtain JDBC Connection,意指JDBC连接失败,可能出现这个错误的地方,properties文件书写有误,需要先检查;如果仔细检查后没有问题,则继续检查是否发生命名冲突的问题。
解决方案:
对于原因2可以采取如下方法解决:
将原数据库配置文件properties
修改成:
最后在spring的配置文件中进行相应的更改即可。
更多推荐
已为社区贡献2条内容
所有评论(0)