【已解決】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.
阿新 • • 發佈:2021-01-11
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.