Invalid operation result set closed errorcode 4470 sqlstate null - fetching DB2 data

I am running a very simple query and trying to extract the results into a text file. The whole query is essentially what is below, I am selecting everything from one table with one piece of criteria that limit the data to one month. After it has extracted about 1.2 gigabytes, this error appears. Is there a way I can get around this other than highlighting smaller date ranges? I have been trying to collect data for a couple of years, so if I can only get it a few days at a time it will take a lot of manual work.

I am currently using a free trial of the DB2 Query Tool - Razor SQL, if that matters I can probably buy other software if it helps. I am trying to get the IBM tool, but for some reason it hangs during boot, so I am still working on it. I have searched for this error, but everything I see seems to be much more complicated than what I am doing and I cannot tell if this applies or not. Thanks in advance.

select *
from MyTable
where date_col between date '2014-01-01' and date '2014-01-31'

      

+3


source to share


3 answers


I also stumbled upon this error, found out that it is related to the db2jcc.jar driver (type 4).

Excerpt: If there are no items in the result set on the left (or to begin with) the result set, the result set is automatically closed and hence an exception. The suggestion is to handle it in the application, maybe in my case I started checking if(rs.next())

, but otherwise, there is work to do. Check the source link below how you can set some properties on the data source and avoid the exception.



Source: Error "Invalid Operation: Result Closed" with Data Server Driver for JDBC

+4


source


In my case, I missed some properties in WAS, after adding allowNextOnExhaustedResultSet the problem was fixed.

1. Log in to the WebSphere Application Server administration console.

2. Select Resources> JDBC> Data Sources> Application Center Data Source Name> Custom Properties and click New.

3. In the Name field, enter allowNextOnExhaustedResultSet.

4.In the Value field, enter 1.

5.Change the java.lang.Integer type.

6.Click OK.



Sometimes you also need to check if the resultSetHoldability properties exist . See here for details .

+1


source


By creating below property with type Integer it worked for me:

allowNextOnExhaustedResultSet :

0


source







All Articles