JDBC Query Palette using Process in subsets shows an exception com.ibm.db2.jcc.am.SqlException, Invalid operation: statement is closed. ERRORCODE=-4470, SQLSTATE=null

JDBC Query Palette using Process in subsets shows an exception com.ibm.db2.jcc.am.SqlException, Invalid operation: statement is closed. ERRORCODE=-4470, SQLSTATE=null

book

Article ID: KB0079391

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 5.x

Description

Sometimes when trying to get data from IBM DB2 database using JDBC Query Palette with "Process in subsets" option, we see the below error message:

BW-JDBC-100014 Error Message: JDBC error reported: (SQLState = null) - com.ibm.db2.jcc.am.SqlException: [jcc][10120][10943][3.71.22] Invalid operation: statement is closed. ERRORCODE=-4470, SQLSTATE=null

Cause:
The IBM Data Server Driver for JDBC and SQLJ automatically closes the cursor when all rows have been retrieved from a ResultSet. When ResultSet.next is executed after the cursor is closed the SQLException is thrown.
 

Issue/Introduction

JDBC Query Palette using Process in subsets shows an exception com.ibm.db2.jcc.am.SqlException, Invalid operation: statement is closed. ERRORCODE=-4470, SQLSTATE=null

Environment

BW 5.x

Resolution

To get around this error, the driver provides a property named "allowNextOnExhaustedResultSet" that can be set on the Database URL. The value for this property must be 1

For example:
-----------------------------------------------
jdbc:db2://server:50000/db:allowNextOnExhaustedResultSet=1;
-----------------------------------------------

With this setting, the call to ResultSet.next returns false instead of throwing an SQLException.

Additional Information

http://www-01.ibm.com/support/docview.wss?uid=swg21461670