Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalid Cusrsor State

 
Dhananjay Ghanwat
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am getting a strange Error while inserting a set of Records
I am doing batc update
using Statement.executeBatch()
It gives me Invalid Cursor State Exception.
 
Jamie Robertson
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post a little code snippet of the offending Connection/Statement/ResultSet code and provide us on some details like which database and database driver you are using.
Jamie
 
R Laksh
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This error comes when you try to access a value from result set without moving the cursor.
i.e rs.next()
Also it may occur if the cursor in result set is reached the last value and again if you try to get a value form the result set.
Hope it helps.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
laks77,
Welcome to JavaRanch!
And thanks for the advice.
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Thanks Pardner! Hope to see you 'round the Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic