DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to get a rollable ResultSet?

  1. #1
    Join Date
    Sep 2001
    Posts
    99

    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

  2. #2
    Join Date
    Sep 2001
    Posts
    99

    How to do?

    plz,help
    thanks
    ocean

  3. #3
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    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
    Christopher R. Long
    ChrisRLong@HotMail.Com
    But that's just my opinion. I could be wrong

  4. #4
    Join Date
    Sep 2001
    Posts
    99

    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
  •  


Click Here to Expand Forum to Full Width