aspose file tools*
The moose likes JDBC and the fly likes CLI0115E  Invalid cursor state Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "CLI0115E  Invalid cursor state" Watch "CLI0115E  Invalid cursor state" New topic
Author

CLI0115E Invalid cursor state

Rehana Shaik
Ranch Hand

Joined: Jan 03, 2003
Posts: 33
Hi,
I am getting CLI0115E Invalid cursor state error when i run the following code

conn = getConnection();
query.append(" SELECT MAX(SUBSTR(SAP_BATCH_NUM,1,10))AS SAP_BATCH_NUM FROM FN_PAY_TRN ");
ps = conn.prepareStatement(query.toString());
ps.execute();
rs = ps.getResultSet();
rs.getString("SAP_BATCH_NUM");//iam getting this error at this level
i tried same query from command line processer it is working.
Please help me to solve this problem.
when i printed rs.wasNull() it is returning true.
Thanks
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

ResultSets start in the 'before first' position: before you move to the first entry, you aren't looking at anything. This why you'll almost always see code like this:

Dave
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CLI0115E Invalid cursor state
 
Similar Threads
Invalid Cusrsor State
problem in updating a row in JDBC
the JDBC "invalid state cursor" error
Invalid cursor state?
Display error when record not found