Paul DuBois wrote:
> At 14:57 -0700 5/6/02, Hans Bergsten wrote:
> 
>> 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 ;-)
> 
> 
> Well, let's see if I understood you. :-) Assuming that I haven't limited
> the result set with maxRows, then rowCount should indeed contain the
> number of rows returned by the query.  Right?

Right :-)

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