Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Java in DB2 CLOB/BLOB + opened cursors errors

0 views
Skip to first unread message

Osipov Egor

unread,
Aug 20, 2002, 9:21:18 AM8/20/02
to
 
Hello!
Please, help us!
Here are errors occur when processing a stored java procedures within a db2.
The error is:
 
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0502N The cursor specified in an OPEN statement is already open. SQLSTATE=24502 

     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:254)
     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:197)
     at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:436)
     at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java:1186)
     at COM.ibm.db2.jdbc.app.DB2PreparedStatement.executeQuery(DB2PreparedStatement.java:757) 
 
the error was at line:      ResultSet rs = ps.executeQuery();
We tried to close cursors naturally by .close(), but it is clear to us, that we haven't closed all Cursors (we saw a number of them using OptimizeIt).
 
and we use a single Connection (java.sql.Connection)
Within this connection we read data from BLOB(1M) field, and write another data to other BLOB(1M) field
The code for writing CLOB is the same as for BLOB (setBytes/getBytes).
And because of program implementation we cannot close a Connection!
 
The question is: 
How can we can close an opened Cursors within a single Connection (java.sql.Connection), but not closing it.
 
Why it works correct with CLOB data type and doesn't with BLOB?
 
P.S. Please, write if you had some similar BLOB/CLOB problems.
 
WBR, Egor.
0 new messages