Well, it's not as silly as one might think. I don't know of any other "official"
way than calling ResultSet.next() until it returns false. You can of course send
a SQL-COUNT-statement, too - but that's not officially supported and might not
be portable.
If there's a better way I'd be interested, too.
-hendrik
- - - - - - - - - - - - - - - - - - - - - - - - - - -
The WebApp Framework http://www.webapp.de/
jo! small&smart 2.1 servletengine
Persistence objectrelational mapping
Java Server & Servlets The German servlet book
Yohans Mendoza wrote:
> I'm new to the JDBC, so this is a silly question for most of you.
>
> How do you count the number of rows returned in a ResultSet?
>
> TIA
>
> --Yohans
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> Yohans Mendoza Unix Administrator
> Sirius Images Inc. [EMAIL PROTECTED]
> http://www2.utep.edu/~yohans http://www.sirius-images.net
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ----------------------------------------------------------------------
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]