用JDBC连接informix数据库,出数据并将数据保存到本地时出现以下异常:
java.sql.SQLException: System or internal error java.net.SocketException: Socket closed
at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:421)
at com.informix.jdbc.IfxSqli.flip(IfxSqli.java:2271)
at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2080)
at com.informix.jdbc.IfxSqli.executeClose(IfxSqli.java:1660)
at com.informix.jdbc.IfxResultSet.close(IfxResultSet.java:1503)
at util.CloseConnection.close(CloseConnection.java:15)
at com.picc.time.TimeDbTask.takeSingle(TimeDbTask.java:99)
at com.picc.time.BugXmlTimerTask.run(BugXmlTimerTask.java:61)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
连接数据库时间视查询得到的数据量而定,而有时出现以下的问题:
java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2851)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1534)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1625)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2297)
at com.mysql.jdbc.Connection.execSQL(Connection.java:2226)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1812)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1906)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1831)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1693)
at com.picc.time.TimeDbTask.takeSingle(TimeDbTask.java:96)
at com.picc.time.BugXmlTimerTask.run(BugXmlTimerTask.java:61)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
作者: hysstrong
发布时间: 2010-10-11