Spring-Mybatis integration
出现:
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)
Solution:
This is a JDBC naming conflict;
change to:
!!! Finally, don't forget to add jdbc to the data in ${} in the applicationContext.xml file.