This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes ResultSet in forward direction error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "ResultSet in forward direction error" Watch "ResultSet in forward direction error" New topic

ResultSet in forward direction error

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I get the error ResultSet accessed in forward direction when my code is this
ResultSet rs=st.executeQuery(query);

But when i use execute() instead of executeQuery().
ResultSet rs=st.getResultSet();
It works fine.
I create the statement scrollable then why this error.
sinasi susam
Ranch Hand

Joined: Jul 15, 2005
Posts: 67
It says;


I think that should be

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
Even if i change scroll insesnsitive to scroll sensitive no change in error .I think scroll-insensitive result set ignores changes that are made while it is open. It provides a static view of the underlying data it contains.If that was the case then why it work when i execute query using execute method
I agree. Here's the link:
subject: ResultSet in forward direction error
Similar Threads
Result set type
Using a scrollable resultset to retrieve 'rowcount'
TYPE_SCROLL_INSENSITIVE corrupts the result set data
invalid cursor type
Scrollabel Result set