By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,610 Members | 1,697 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,610 IT Pros & Developers. It's quick & easy.

Cursor Not In Prepared State

P: n/a
I am getting this error from BEA DB2 Driver in weblogic console.

java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]CURSOR C02 NOT IN A
PREPARED STATE
java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]CURSOR C02 NOT IN A
PREPARED STATE

We keep running into this problem, frequently almost everyday. We figured
what exactly to do when the problem happens but not the reason or the
solution to this.

When this error happens we clear the statement cache by logging in to the
weblogic console (which clears the cache of prepared and callable statements
maintained for each connection in the connection pool) and this solves the
problem without the need to restart the server.
SQL0514N The cursor name is not in a prepared state.

Explanation: The application program tried to use a cursor name that is not
in a prepared state. The cursor is associated with a statement that either
(1)*was never prepared, (2)*was made not valid by a ROLLBACK, or (3)*was
made not valid by either an explicit or implicit rebind of the package.
The statement cannot be processed.
User Response: For case (1), prepare the statement named in the DECLARE
CURSOR statement for name before you try to open the cursor. For case (2),
do not issue a ROLLBACK until after you finish using the cursor. For case
(3), the prepare for the cursor must be reissued.
sqlcode: -514
sqlstate: 26501

TIA
Hari.
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.