A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Servlets
Author
how to display more than one result from the db..
City Guy
Greenhorn
Joined: Oct 15, 2001
Posts: 2
posted
Oct 15, 2001 14:20:00
0
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
posted
Oct 15, 2001 14:32:00
0
<code>
if(rs != null)
{
while(rs.next())
{
x = rs.getString("X");
}
}
</code>
SCJP2
namita pa
Ranch Hand
Joined: Sep 06, 2001
Posts: 56
posted
Oct 16, 2001 01:34:00
0
ya its better to do it in the while loop as it checks all the records in the resultset
------------------
I agree. Here's the link:
http://aspose.com/file-tools
subject: how to display more than one result from the db..
Similar Threads
Error in downloading ZipoutputStream
gettting value by column name vs index
describing the table!!!...
WA #1.....word association
Regex | Parse | Split?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter