Paul DuBois wrote:
> After issuing a SELECT query with <sql:query>, you can access the row
> count with ${rs.rowCount} (where rs is the result set variable).
> 
> However, in other APIs such as Perl DBI, the equivalent construct
> is deprecated because some drivers do not return a count reliably;
> the recommended course of action is to count the rows as you fetch
> them.
> 
> Is there any such constraint or caution in JSTL?

The "rowCount" property of the Result class contains the number of rows
in the Result. In other words, if you have limited the amount of
rows with the "maxRows" attribute, "rowCount" has the same value as
"maxRows" and "isLimitedByMaxRows" is "true".

It's true that JDBC drivers can not provide the number of rows returned
for a query until you retrieve them, but with <sql:query> all rows (upto
"startRow" + "maxRows") are retrieved and the "rowsCount" value is
therefore an accurate number for the number of rows in the Result.

I hope that made some kind of sense ;-)

Hans
-- 
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com
JavaServer Pages        http://TheJSPBook.com


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to