File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes number  of rows   Resultset ??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "number  of rows   Resultset ???" Watch "number  of rows   Resultset ???" New topic
Author

number of rows Resultset ???

Bhiku Mhatre
Ranch Hand

Joined: Apr 08, 2002
Posts: 127
how do I know number of results fetched by query?? Is there any method in ResultSet class ??


The difference between winner and loser is making things happen and letting things happen.
Rajendar Goud
Ranch Hand

Joined: Mar 06, 2002
Posts: 220
Hi
u dont have a method directly which gives u the
Row count by a resultset.u can get the rowcount
in oracle using
count(*)
for a query.
well ,if u want to know the number of records fetched ,then use a local variable and keep it in loop thru
while(rs.next)
variable ++
print out the variable.

Raj
Elahe Shafie
Ranch Hand

Joined: Dec 12, 2001
Posts: 291
See my code:


Thanks,
Elahe
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: number of rows Resultset ???