wood burning stoves 2.0*
The moose likes JDBC and the fly likes Cursor state not valid. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Cursor state not valid." Watch "Cursor state not valid." New topic
Author

Cursor state not valid.

Luis Fernandes
Greenhorn

Joined: Sep 22, 2007
Posts: 19
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


Luis Claudio<br />MCSE ; CCNA ; SCJP 5.0
Akshay Kiran
Ranch Hand

Joined: Aug 18, 2005
Posts: 220
change the
ResultSet.. line to

boolean b= prepared_statement.execute() ;
think that should fix it.


"It's not enough that we do our best; sometimes we have to do<br />what's required."<br /> <br />-- Sir Winston Churchill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cursor state not valid.
 
Similar Threads
Getting path with Tree Listener
closing connection?
How to configure Bonecp in java project without breaking connection when more than connection
out of range
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor state