This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes how to display more than one result from the db.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "how to display more than one result from the db.." Watch "how to display more than one result from the db.." New topic
Author

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

City Guy
Greenhorn

Joined: Oct 15, 2001
Posts: 2
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

Joined: Sep 05, 2001
Posts: 139
<code>
if(rs != null)
{
while(rs.next())
{
x = rs.getString("X");
}
}
</code>


SCJP2
namita pa
Ranch Hand

Joined: Sep 06, 2001
Posts: 56
ya its better to do it in the while loop as it checks all the records in the resultset
------------------
 
Have you checked out Aspose?
 
subject: how to display more than one result from the db..
 
It's not a secret anymore!