The Artima Developer Community
Sponsored Link

Java Answers Forum
How to count total rown using jdbc

1 reply on 1 page. Most recent reply: Apr 10, 2002 11:56 PM by nagu

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Binod Pokharel

Posts: 9
Nickname: binod
Registered: Mar, 2002

How to count total rown using jdbc Posted: Apr 10, 2002 12:53 PM
Reply to this message Reply
Advertisement
I go the Resultset back from executing sql statement doing executequery but I do not see any method to count rows associated with the Resultset. Just let me know if there is good way; that would be of great help to me.

Bye


nagu

Posts: 7
Nickname: nagu
Registered: Apr, 2002

Re: How to count total rown using jdbc Posted: Apr 10, 2002 11:56 PM
Reply to this message Reply
Hi,

There is one method getRowCount() in jdbc3.0 to now the no of rows in a ResultSet.

The same thing can be done programmatically.

int i= 0;

while(resultSet.next()){

i = i+1;

}

the final value of i will give you the rowcount of the ResultSet.

Hope this will clear your problem.u can contact npbarla@rediffmail.com for further help

Flat View: This topic has 1 reply on 1 page
Topic: Word Frequency Help Previous Topic   Next Topic Topic: BlueJ anyone?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use