There isn't really.
The reason is simple, in order to get the number of rows, the server has to
perform the query first.
That might happen in the database server or in the app server or anywhere,
but somehow all rows must be counted. Most databases are optimized for
performance ;-) and start serving rows as fast as possible. So normally,
even the database server doesn't know the number of rows in a query unless
it's done.
If a DBMS or an app server gives you a function to get the number of rows,
it always comes with a performance cost. In that case, I'd rather not have
the number but better performance.
Geert 'Darling' Van Damme
> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Medha Rangnekar
> Sent: vrijdag 30 juni 2000 1:37
> To: [EMAIL PROTECTED]
> Subject: any function in java.sql to give no of rows?
>
>
> I need to know the total no of rows a query returns in my JSP
> application. I
> am new to JSP. I know that in ColdFusion there is such function like
> queryname.recordcount
> I looked on sun site for Resultset methods and also for resultSetMetaData
> methods. I did not find one. I found one GetFetchSize but seems like it
> gives the buffer size.
> Any help is appreciated.
>
> Thanks,
> Medha
>
> ==================================================================
> =========
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets