org.springframework.jdbc.CannotGetJdbcConnectionException_JAVA_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > JAVA > org.springframework.jdbc.CannotGetJdbcConnectionException

org.springframework.jdbc.CannotGetJdbcConnectionException

 2011/11/18 7:58:58  MyCrazy  http://mycrazy.iteye.com  我要评论(0)
  • 摘要:1,问题现象org.springframework.jdbc.CannotGetJdbcConnectionException:CouldnotgetJDBCConnection;nestedexceptionisorg.apache.commons.dbcp.SQLNestedException:CannotcreatePoolableConnectionFactory(Accessdeniedforuser'root'@'localhost'(usingpassword:YES))org
  • 标签:Framework can not Spring
1,问题现象
org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root   '@'localhost' (using password: YES))
org.springframework.orm.ibatis.SqlMapClientTemplate.execute(SqlMapClientTemplate.java:195)
org.springframework.orm.ibatis.SqlMapClientTemplate.queryForList(SqlMapClientTemplate.java:293)
com.knowledge.data.dao.imp.ContentDAOImp.queryContent(ContentDAOImp.java:13)
com.knowledge.data.service.imp.ContentServiceImp.queryContent(ContentServiceImp.java:20)
com.knowledge.data.action.ContentAction.queryContent(ContentAction.java:39)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
2,问题分析
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" scope="singleton">
<property name="driverClassName" value="com.mysql.jdbc.Driver" />
<property name="url" value="jdbc\:mysql\://localhost\:3306/knowledge" /> <property name="username" value="root" />
<property name="password" value="root" />
</bean>

多了“\”

3,问题解决方法去掉“\”
发表评论
用户名: 匿名