错误:循环报错errorCode 1045, state 28000
严重: create connection SQLException, url: jdbc:mysql://localhost:3306/studb, errorCode 1045, state 28000
java.sql.SQLException: Access denied for user '�羊'@'localhost' (using password: YES)
在其他博客文章看到说是mysql的username名字冲突,遂改为jdbc.username![](https://img-blog.csdnimg.cn/direct/1d62adef3e7041f8928a642f58d4f2ca.png)
报新错误![](https://img-blog.csdnimg.cn/direct/66cdcdb4866e4d898e51306398c2c218.png)
错误:dataSource
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-01.xml]: Failed to convert property value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver'; Cannot convert value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver': no matching editors or conversion strategy found
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [spring-01.xml]: Failed to convert property value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver'; Cannot convert value of type 'java.lang.String' to required type 'java.sql.Driver' for property 'driver': no matching editors or conversion strategy found
最后ioc配置里,driver也需改为driverClassName,运行成功
综上:需将jdbc.properties配置文件里面的username改为jdbc.username,并且将,ioc容器里面的<property name="driver" value="${driver}"/>改为<property name="driverClassName" value="${driver}"/>
小白一枚,暂不知具体原因...