Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

CLI0115E Invalid cursor state

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic