我在Web应用程序中使用Java,Spring和SQL Server。我有一个存储过程。返回超过65000行。我这样称这个存储过程:
pstmt = conn.prepareCall(procQueryString);
pstmt.setString(1, argIDList);
pstmt.setTimestamp(2, new Timestamp(argStartDate.getTime()));
pstmt.setTimestamp(3, new Timestamp(argEndDate.getTime()));
// execute query
rs = pstmt.executeQuery();
// iterate result set
while(rs.next())
{
// do smt
}
执行查询时会出现此错误:
java.sql.SQLException: I/O Error: Connection reset
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1053)
at net.sourceforge.jtds.jdbc.JtdsStatement.executeSQLQuery(JtdsStatement.java:465)
at net.sourceforge.jtds.jdbc.JtdsPreparedStatement.executeQuery(JtdsPreparedStatement.java:779)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at tr.com.tridem.eMOVE.dao.MUDistanceLogDAO.getMuMovementActivityList(MUDistanceLogDAO.java:485)
at tr.com.tridem.eMOVE.blo.ReportBLO.getMovementActivityReport(ReportBLO.java:7284)
at tr.com.tridem.eMOVE.blo.ReportBLO.getMovementActivityReport(ReportBLO.java:7231)
at tr.com.tridem.eMOVE.command.report.MovementReportCmd.processCommand(MovementReportCmd.java:41)
at tr.com.tridem.eMOVE.command.report.BaseReportCmd.execute(BaseReportCmd.java:65)
at tr.com.tridem.framenet.NKRoutingLogic.execute(NKRoutingLogic.java:34)
at tr.com.tridem.framenet.NKFrontController.service(NKFrontController.java:519)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at tr.com.tridem.framenet.ThinCommFilter.doFilter(ThinCommFilter.java:105)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.io.DataInputStream.readFully(DataInputStream.java:178)
at java.io.DataInputStream.readFully(DataInputStream.java:152)
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:846)
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:727)
at net.sourceforge.jtds.jdbc.ResponseStream.getPacket(ResponseStream.java:466)
at net.sourceforge.jtds.jdbc.ResponseStream.read(ResponseStream.java:103)
at net.sourceforge.jtds.jdbc.ResponseStream.peek(ResponseStream.java:88)
at net.sourceforge.jtds.jdbc.TdsCore.wait(TdsCore.java:3932)
at net.sourceforge.jtds.jdbc.TdsCore.executeSQL(TdsCore.java:1046)
如何修复此错误?总而言之。