Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Get Invalid Cursor state error for JTA

843859Apr 1 2009 — edited Apr 3 2009
I am working on a program which requires me to replace DB replication, means each database updates needs to be applied to each database by app code. I have written this using JDBC and JTA API for supporting global transactions, I am using Db2 as database, Weblogic v10 as app(datasources are configured with XA drivers to support global transactions).

...................
ctx = new InitialContext(env);
UserTransaction tx = (UserTransaction)ctx.lookup("javax.transaction.UserTransaction");
DataSource ds=(DataSource)ctx.lookup("myDS2");
Connection con=ds.getConnection();
tx.begin();
PreparedStatement stmt=con.prepareStatement("select first_name from person");
ResultSet rset=stmt.executeQuery();
while(rset.next()){
System.out.println(rset.getInt(1));
}
tx.commit();

..................................

Am able to apply database updates with no problem, but when i try to use select stmt, i get this error:

COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0115E Invalid cursor state. SQLSTATE=24000
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:164)
at weblogic.jdbc.rmi.internal.ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_COM_ibm_db2_jdbc_app_DB2ResultSet_1001_WLStub.next(Unknown Source)
at weblogic.jdbc.rmi.internal.ResultSetStub_weblogic_jdbc_rmi_internal_ResultSetImpl_weblogic_jdbc_wrapper_ResultSet_COM_ibm_db2_jdbc_app_DB2ResultSet_1001_WLStub.next(Unknown Source)
at weblogic.jdbc.rmi.internal.ResultSetStraightReader.next(ResultSetStraightReader.java:27)

Am struck with this, please Help!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 1 2009
Added on Apr 1 2009
7 comments
442 views