Forums Register Login

ResultSet in forward direction error

+Pie Number of slices to send: Send
I get the error ResultSet accessed in forward direction when my code is this
st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
ResultSet rs=st.executeQuery(query);
rs.last();

But when i use execute() instead of executeQuery().
st=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
st.execute(query);
ResultSet rs=st.getResultSet();
rs.last();
It works fine.
I create the statement scrollable then why this error.
Thanks
+Pie Number of slices to send: Send
It says;

ResultSet.TYPE_SCROLL_INSENSITIVE

I think that should be

ResultSet.TYPE_SCROLL_SENSITIVE
+Pie Number of slices to send: Send
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
this is supposed to be a surprise, but it smells like a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1139 times.
Similar Threads
Using a scrollable resultset to retrieve 'rowcount'
Result set type
invalid cursor type
TYPE_SCROLL_INSENSITIVE corrupts the result set data
Scrollabel Result set
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:09:41.