The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
October 2000

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

RowCount in resultset

Posted by Kishori Sharan on October 11, 2000 at 9:37 AM

Hi
I couldn't find any method of resultset which gives you the total no of rows in it. One way is
public int getRowCount ( ) {

int count = 0 ;

// Fetch the records in resultset ( rs )
...
...
while ( rs.next( ) ) {
count++ ;
}
return count ;
}

But, if you want to use the resultset for any other purpose then you may have to create the resultset so that you may scroll in both directions.
Thanx
Kishori



Replies:
  • Row count Devanshi March 16, 2001 at 2:22 AM (1)
    • resultset amar April 23, 2001 at 9:26 AM (0)

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us