Solved

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

Posted on 2002-03-31
1
150 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
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupSum5 challenge 5 85
maven project error 5 56
Apps blocked by Java 9 80
web application structure 18 77
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

809 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