Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Oracle 8i Cursors via JDBC

Oracle 8i Cursors via JDBC

From: David <d.wall_at_computer.org>
Date: 29 Oct 2003 18:01:43 -0800
Message-ID: <1e8a93d.0310291801.cae49b2@posting.google.com>


Does anybody have samples of how to use JDBC calls to work with a cursor on Oracle 8i? Can it even be done?

I'd like to be able to do something like:

String sql = "DECLARE CURSOR my_cursor FOR SELECT name,id FROM name_tbl";
statement.execute(sql); (executeQuery? executeUpdate?) ...
while(...)
{
  String query = "FOR 100 FETCH my_cursor";   ResultSet rs = statement.executeQuery(query);
// process up to 100 rows in another loop and then fetch 100 more
// how do I know when the cursor has run out of rows versus just
// the ResultSet running out of its rows (do I just try again as
long
// as I get 100 rows in ResultSet or is there something else that
tells me?
}

Thanks,
David Received on Wed Oct 29 2003 - 20:01:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US