Tomcat6配置mysql的连接池,老是报错
<Resourcename="orcl_cr21"auth="Container"type="javax.sql.DataSource"maxActive="100"ma...
<Resource name="orcl_cr21" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="100"
username="root" password="cr21" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/cr21"/>
操作错误,请重新操作!
方法名:'execute';
错误信息:Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Communications link failure The last packet successfully received from the server was 1,365,384,179,140 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet successfully received from the server was 1,365,384,179,140 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.) 展开
maxActive="100" maxIdle="30" maxWait="100"
username="root" password="cr21" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/cr21"/>
操作错误,请重新操作!
方法名:'execute';
错误信息:Hibernate operation: Cannot open connection; uncategorized SQLException for SQL [???]; SQL state [null]; error code [0]; Cannot create PoolableConnectionFactory (Communications link failure The last packet successfully received from the server was 1,365,384,179,140 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.); nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Communications link failure The last packet successfully received from the server was 1,365,384,179,140 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.) 展开
2个回答
展开全部
url="jdbc:mysql://localhost:3306/cr21"/>改为url="jdbc:mysql://localhost:3306/数据库的名字"/>
并在cmd中输入netstat -ano查看端口占用情况,查看是否有被占用的3306端口,若没有则把 localhost端口该成占用着的端口,若有占用的端口为3307,则改为url="jdbc:mysql://localhost:3307/数据库的名字"/>
供以后查找这个问题的人方便
并在cmd中输入netstat -ano查看端口占用情况,查看是否有被占用的3306端口,若没有则把 localhost端口该成占用着的端口,若有占用的端口为3307,则改为url="jdbc:mysql://localhost:3307/数据库的名字"/>
供以后查找这个问题的人方便
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询