Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display more than one result from the db..

 
City Guy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if (rs != null) {
if (rs.next()) {
xxx = rs.getString("");
xxx = rs.getString("");
xxx = rs.getString("");
xxx = rs.getString("");
xxx = rs.getString("");
this will only disply one record ...
 
Mahesh Rana
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<code>
if(rs != null)
{
while(rs.next())
{
x = rs.getString("X");
}
}
</code>
 
namita pa
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya its better to do it in the while loop as it checks all the records in the resultset
------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic