ssh项目 mysql数据库连接问题,求解
org.springframework.dao.DataAccessResourceFailureException:couldnotexecutequery;neste...
org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:612)
.....
Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
...
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Software caused connection abort: recv failed
STACKTRACE:
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
...
** END NESTED EXCEPTION **
Last packet sent to the server was 9302 ms ago.
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2622)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
...
执行sql:
select gameprops0_.PropsID as PropsID16_, gameprops0_.GameID as GameID16_, gameprops0_.TypeID as TypeID16_, gameprops0_.GamePropsID as GameProp4_16_, gameprops0_.GamePropsPrice as GameProp5_16_, gameprops0_.GamePropsName as GameProp6_16_, gameprops0_.GamePropsIntroduce as GameProp7_16_, gameprops0_.IsActive as IsActive16_, gameprops0_.GamePropsUnit as GameProp9_16_ from Zhijia_Gfamily_T_GameProps gameprops0_ where gameprops0_.GamePropsID=? and gameprops0_.IsActive=1 展开
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:612)
.....
Caused by: org.hibernate.exception.JDBCConnectionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
...
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
** BEGIN NESTED EXCEPTION **
java.net.SocketException
MESSAGE: Software caused connection abort: recv failed
STACKTRACE:
java.net.SocketException: Software caused connection abort: recv failed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
...
** END NESTED EXCEPTION **
Last packet sent to the server was 9302 ms ago.
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2622)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2916)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
at com.mysql.jdbc.Connection.execSQL(Connection.java:3283)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1332)
...
执行sql:
select gameprops0_.PropsID as PropsID16_, gameprops0_.GameID as GameID16_, gameprops0_.TypeID as TypeID16_, gameprops0_.GamePropsID as GameProp4_16_, gameprops0_.GamePropsPrice as GameProp5_16_, gameprops0_.GamePropsName as GameProp6_16_, gameprops0_.GamePropsIntroduce as GameProp7_16_, gameprops0_.IsActive as IsActive16_, gameprops0_.GamePropsUnit as GameProp9_16_ from Zhijia_Gfamily_T_GameProps gameprops0_ where gameprops0_.GamePropsID=? and gameprops0_.IsActive=1 展开
2个回答
展开全部
请您贴出来 报错前,执行的最后一句SQL。
既然是因为8小时连接关闭问题,那就试着设置久一点超时时间咯。
既然是因为8小时连接关闭问题,那就试着设置久一点超时时间咯。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询