1. 程式人生 > 其它 >【已解決】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.

【已解決】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.

技術標籤:mybatisspringmybatisjdbc

Spring-Mybatis整合

出現:
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 異常

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 
### Error updating database.  Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'Y7000'@'localhost' (using password: YES)
### The error may exist in file [D:\從零開始\spring\bj-SpringStudy-Mybatis01\bj-SpringMybatis-01\target\classes\com\jcjava\mapper\UserMapper.xml]
### The error may involve com.jcjava.mapper.UserMapper.insertUser
### The error occurred while executing an update
### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: Access denied for user 'Y7000'@'localhost' (using password: YES)

解決方法:
這個是JDBC命名衝突的問題;
在這裡插入圖片描述改為:
在這裡插入圖片描述!!! 最後別忘記在applicationContext.xml檔案中${}中的資料加上jdbc.