I have a java application on Windows 2000 that uses the JDBC DB2 driver to connect and execute queries.

After adding the setQueryTimeout() method,
the application will get an access violation error after running for several days.

Has anyone seen this happen?

MJ Fontana

Here is the basic code (without the try/catch/finally block)

Connection con;
Statement stmt;
ResultSet rs;
try {
stmt = con.createStatement();
rs = stmt.executeQuery("SELECT ...");
while (rs.next()) {
// do something
// also close connection

Here's an example back trace.
Violation occurs in SQLGetSubStringInt.

Application exception occurred:
App: java.exe (pid=3092)
When: 12/6/2003 @ 22:08:07.899
Exception number: c0000005 (access violation)

State Dump for Thread Id 0x540

6c1de4c1 0f8e6b010000 jle SQLGetSubStringInt+0x11682 (6c1de632)
6c1de4c7 8bf6 mov esi,esi
6c1de4c9 8dbc2700000000 lea edi,[edi] ds:00000111=????????
6c1de4d0 8b4808 mov ecx,[eax+0x8] ds:6ca50e2a=????????

FAULT ->6c1de4d3 8b0cb9 mov ecx,[ecx+edi*4] ds:00000111=????????

6c1de4d6 85c9 test ecx,ecx

*----> Stack Back Trace <----*

FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
06B1FF80 7800C9EB 6C23832C 05149E65 0122DAD8 05699C90 db2cli!SQLGetSubStringInt
06B1FFB4 7C57B382 05699C90 05149E65 0122DAD8 05699C90 !beginthread
06B1FFEC 00000000 7800C994 05699C90 00000000 06A10000 kernel32!lstrcmpiW

another stack back trace ...

FramePtr ReturnAd Param#1 Param#2 Param#3 Param#4 Function Name
06CBFF7C 78008454 6C23832C 05149E35 0122DD60 05681FB8 db2cli!SQLGetSubStringInt
06CBFFB4 7C57B382 05681FB8 05149E35 0122DD60 05681FB8 !endthread
06CBFFEC 00000000 780083D2 05681FB8 00000000 06B98000 kernel32!lstrcmpiW