• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

how can I get the record number of resultset?

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I won't like to get the record number of resultset using:
int i=0;
while(rs.next()){
i++;
}
or this:
ResultSet rs;
int count;
��
rs.last();
count = rs.getRow();
��
have any good idea? thanks a lot!
Winny
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i don't what u r trying to ask....u want to know on which row of Database u r resultset is on...RIGHT....if this the case the
int i=0;
int countRow=0;
while (rs.next())
System.out.println(countRow);
i++;
}
hope this helps....
Bye
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Zero Degree",
Your display name does not comply to the JavaRanch naming standards. You can view the rules here
Please change your display name. Accounts with invalid display names get deleted.
Also, please try to reduce your usage of contractions such as u, r, ur etc. Many of the Ranch users do not have English as their primary language, and it is a good idea try to make communication easier, not harder.
thanks,
Dave.
 
Winny Zhang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean I hope to get the record number of the resultset,and don't use that two ways .

Thanks!
My english is not very good .sorry
Winny
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic