• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cursor state not valid.

 
Luis Fernandes
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I receive the following error :


here is my code :


After the code insert the firt row , it send me the exception : java.sql.SQLException: Cursor state not valid.

I know that the source ( ptabela ) have 500 rows (in this case i only want 10 rows), but i dont know why, the code write in database the first rows and after that trows me the exception.

Whats wrong with my code ?

regards
 
Akshay Kiran
Ranch Hand
Posts: 220
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
change the
ResultSet.. line to

boolean b= prepared_statement.execute() ;
think that should fix it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic