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

Home -> Community -> Usenet -> c.d.o.server -> Re: To know the number of results returned just after query ??

Re: To know the number of results returned just after query ??

From: <NOS_at_Utel.no>
Date: Thu, 2 Aug 2001 19:07:50 +0100
Message-ID: <mt4ck9.es2.ln@space.net>

Isma wrote:

> Hi,
>
> I use a JDBC driver. I want to know whether exists a command to know the
> results number just after the query.(i.e. lines)
>
> [I know it exists getColumnCount() to know the number of columns return
> ..
> int numcols = rsmd.getColumnCount();

No such thing exists, you must either: loop through the resultset and count yourself (pretty easy). Issue a query. something like "select count(*) from XXX where <same condition ...."
Or if you use a scrollable resultset, du ResultSet.last(), to jump to the last record, and get its rownumnber, the jump to the first record again, and proceed as usual

--
Nils O. SelÄsdal
Received on Thu Aug 02 2001 - 13:07:50 CDT

Original text of this message

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