Solved

How to find out a total # of rows in a ResultSet object??

Posted on 2002-03-31
1
153 Views
Last Modified: 2012-05-04
Hi Guys,

   It seems ResultSet object does not have any member function to find out total number of rows??

stephen
0
Comment
Question by:zollen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
girionis earned 50 total points
ID: 6909686
 No there is not but you can always move to the last row in the ResultSet by using the last() method and get the count by calling the getRow() method straight after you move to the last row. This will give you the total number of rows. You have to define your ResultSet to be scrollable though (if you want to go back) by using the static TYPE_SCROLL_SENSITIVE.

  Hope it helps.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question