Home > Archive > PostgreSQL JDBC > April 2005 > Re: Getting the number or row returned by a select. Alway









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Getting the number or row returned by a select. Alway
Kris Jurka

2005-04-15, 8:24 pm



On Fri, 15 Apr 2005, David Gagnon wrote:

> So did I miss something obvious. Is it possible to get the total number
> of row returned from a query without doing another select.
>


Anytime you've got the results of a query you can loop over it to count
the number of elements. In JDBC with a scrollable ResultSet you may issue
rs.last() and rs.getRow() to get the number of rows. rs.beforeFirst()
will then reset the ResultSet back to its original state.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com