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
展开
 我来答
heyongsai
2014-03-04 · TA获得超过1184个赞
知道小有建树答主
回答量:472
采纳率:0%
帮助的人:301万
展开全部
请您贴出来 报错前,执行的最后一句SQL。

既然是因为8小时连接关闭问题,那就试着设置久一点超时时间咯。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
yudanhome1
2014-03-03 · 超过36用户采纳过TA的回答
知道答主
回答量:165
采纳率:100%
帮助的人:98.7万
展开全部
你的数据库已经连上了,是你的sql语句有问题……
追问
我把sql直接复制到数据库能够运行,
网上查了有些说是mysql数据库默认8小时无连接则关断连接,此时继续执行sql就会这样的错,
奇怪的是用浏览器访问不会报错,android客户端访问才报错...
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式