Error creating bean with name 'connection' defined in class path resource [applicationContext.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.sql.Connection]: Factory method 'getConnection' threw exception; nested exception is java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES)
今天在学spring中遇到的报错问题,以上是报错提示,在仔细检查文件的配置和映射等后,主要问题还是在这句Access denied for user 'root'@'localhost' (using password: YES)了
才发现原来是数据库没连上,发现自己的数据库密码输错了
大家一定要记得自己的数据库账号密码要不然很麻烦的了