This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes SQL Exception: 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 and Relational Databases
Bookmark "SQL Exception: Cursor state not valid" Watch "SQL Exception: Cursor state not valid" New topic

SQL Exception: Cursor state not valid

Dominic Steng�rd
Ranch Hand

Joined: Feb 05, 2001
Posts: 186
Hey fellow javacoders!

Im running JDBC on top of a DB2 database.
When I run the following code:

I get the following error when rs.beforeFirst() is executed:

Have you guys got any thoughts on why this is happening and how to solve it?
Thanks in advance!

Kind regards
[ March 08, 2008: Message edited by: Dominic Steng�rd ]

Dominic Steng�rd<br />Sun Certified Java 2 Programmer
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi Dominic,

Check DB2's documentation if it supports this at all.
Lookign at your code, I think you don't need this line anyway.

I agree. Here's the link:
subject: SQL Exception: Cursor state not valid
It's not a secret anymore!