3

我正在使用 sql server 数据库、jtds 驱动程序和 java1.6.0_16。

在我的客户端代码中,我想执行一些查询(存储过程)并将数据写入文件。第一个查询成功执行并写入文件。第二个查询成功执行,在从结果集对象迭代时,它抛出异常“java.sql.SQLException: I/O Error: Connection reset”

**Below is the Full Stack Trace :**

Caused by: java.sql.SQLException: I/O Error: Connection reset
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2277)
at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:761)
at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:593)
 ... 2 more
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.io.DataInputStream.readFully(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.readPacket(SharedSocket.java:860)
at net.sourceforge.jtds.jdbc.SharedSocket.getNetPacket(SharedSocket.java:707)
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.readInt(ResponseStream.java:320)
at net.sourceforge.jtds.jdbc.TdsData.readData(TdsData.java:652)
at net.sourceforge.jtds.jdbc.TdsCore.tdsRowToken(TdsCore.java:2968)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2236)

请注意:使用 java 1.5 时,它可以成功运行,没有任何问题。使用 java 1.6.0_16 时发生错误。Google 对我没有帮助。

提前致谢

问候,甘尼桑

4

0 回答 0