• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how can I get the record number of resultset?

 
Winny Zhang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
 
F A H A D
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • 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
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic