Solved

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

Posted on 2002-03-31
1
143 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
Comment Utility
 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

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…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now