JDBC - Need help getting a scrollable resultset!!!
Posted on 2004-11-22
I am having a problem with the following code, as I would like to have a scroll_insensitive resultset in order to use the resultset.getfirst() method:
CallableStatement cs = myConnection.prepareCall("call MY PROC",ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = ((OracleCallableStatement)cs).getCursor(1);
rs.beforeFirst(); --> This throws the following exception:
java.sql.SQLException: Invalid operation for forward only resultset : beforeFirst
Now, I am assuming that since I am declaring a new ResultSet object below where I declare my callablestatement, that this is the reason why my program thinks I have a forward-only resultset.
Can anyone suggest a way to make this resultset scroll_insensitive? I am drawing a blank here..
Thanks for any help!