Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / September 2005

Tip: Looking for answers? Try searching our database.

JSP: How to get the Recordcount of <sql:query ?

Thread view: 
Udo Berg - 13 Sep 2005 21:07 GMT
Hi,
In my JSP-Page I have this Code:

<sql:query dataSource="${foo}" var="bar">
select ID from table
</sql:query>

How can I get the recordcount of  this query?
Udo
Bill Karwin - 14 Sep 2005 20:54 GMT
> <sql:query dataSource="${foo}" var="bar">
>  select ID from table
> </sql:query>
>
> How can I get the recordcount of  this query?

In general, getting a recordcount of a query cannot be done until the
rows have been returned.  Even the DBMS may not have a reliable count
available as it returns the first rows of the result set.

Also, the solution may be vendor-dependant.

You can always do this:
 <sql:query dataSource="${foo}" var="bar_count">
  select COUNT(ID) from table
 </sql:query>

Regards,
Bill K.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.