-
How to get a rollable ResultSet?
I created a procedure as follows:
create or replace package types
as
type cursorType is ref cursor;
end;
/
create or replace function sp_ListEmp return types.cursortype
as
l_cursor types.cursorType;
begin
open l_cursor for select ename, empno from emp order by ename;
return l_cursor;
end;
then I use java jdbc to get the ResultSet
CallableStatement cs = myConn.prepareCall("{? = call sp_ListEmp}",ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
cs.registerOutParameter(1,OracleTypes.CURSOR);
cs.execute();
ResultSet rs = (ResultSet)cs.getObject(1);
It works ok.
but when I invoke the method rs.beforeFirst(), an error occurs.
How I can do?
Plz,help
ocean
-
-
Not that I know anything about java, but you never want to post something and only say 'an error occurs'. Tell people what the exact error is and maybe you'll get somewhere.
- Chris
-
The error info is Chinese
I use the Chinese version.The error means the resultset only be allows to scroll backword. I use the befortFirst, it means forword the resultset ,so failed.
I want get a resultset can forword and backword.
ocean
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|