| Author |
How to find the number of rows in a Resultset object
|
ramchander yshetti
Ranch Hand
Joined: Apr 22, 2006
Posts: 97
|
|
Hi All, I am facing a problem in finding how to know the number of rows/records in a Resultset object. Plz. give the possible ways other than using a counter variable and incrementing in while we traverse the resultset using a loop. Bye Ramchander
|
 |
fred Joly
Ranch Hand
Joined: Jan 19, 2006
Posts: 55
|
|
last() : Moves the cursor to the last row in this ResultSet object. getRow() : Retrieves the current row number. regards
|
 |
Naseem Khan
Ranch Hand
Joined: Apr 25, 2005
Posts: 809
|
|
regards Naseem Khan
|
Asking Smart Questions FAQ - How To Put Your Code In Code Tags
|
 |
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26496
|
|
Ramchander, For a more detailed explanation, take a look at the first FAQ.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Scott Selikoff
Saloon Keeper
Joined: Oct 23, 2005
Posts: 3666
|
|
|
In general you can't. Sometimes the driver and dbms support it but even it were to, you might be sacraficing portability.
|
My Blog: Down Home Country Coding with Scott Selikoff
|
 |
Naseem Khan
Ranch Hand
Joined: Apr 25, 2005
Posts: 809
|
|
Hi Scott, Its not the question of dbms. Once you get the result in a ResultSet, now the question is whether your JDBC driver support Scrollable ResultSet or not. Regards Naseem
|
 |
 |
|
|
subject: How to find the number of rows in a Resultset object
|
|
|