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.