DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Han Thai Guest

    Displaying total records


    Hello,

    Does anyone know if there is a function in Java to count the total records
    in a resultset? I would like to display the total records retrieved from
    a query before the table of results. Please help. Many thanks in advance.

    Han


  2. #2
    Kent Guest

    Re: Displaying total records


    Han,

    There is no method in the ResultSet interface to do this. Instead, just use
    another query beforehand:

    select count(*) as record_count from table_name

    Regards,
    Kent


    "Han Thai" <hthaifr@hotmail.com> wrote:
    >
    >Hello,
    >
    >Does anyone know if there is a function in Java to count the total records
    >in a resultset? I would like to display the total records retrieved from
    >a query before the table of results. Please help. Many thanks in advance.
    >
    >Han
    >



  3. #3
    Han Thai Guest

    Re: Displaying total records


    Thanks, Kent.

    Regards,
    Han


    "Kent" <kb@essential.com.au> wrote:
    >
    >Han,
    >
    >There is no method in the ResultSet interface to do this. Instead, just

    use
    >another query beforehand:
    >
    >select count(*) as record_count from table_name
    >
    >Regards,
    >Kent
    >
    >
    >"Han Thai" <hthaifr@hotmail.com> wrote:
    >>
    >>Hello,
    >>
    >>Does anyone know if there is a function in Java to count the total records
    >>in a resultset? I would like to display the total records retrieved from
    >>a query before the table of results. Please help. Many thanks in advance.
    >>
    >>Han
    >>

    >



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links