Title: Message
Thank you Vikramjit Singh.
 
Both codes worked perfectly! =)
 
 
Rama
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference [mailto:[EMAIL PROTECTED]] On Behalf Of Vikramjit Singh
Sent: Wednesday, January 30, 2002 11:29 PM
To: [EMAIL PROTECTED]
Subject: Re: JDBC

or u can write
 
if (rs.next()) {
 rs.beforeFirst();
  while (rs.next()) {
    out.println("username " + rs.getString("username"));
  }
}
else {
  out.println("No record found");
}
 

Vikramjit Singh,
Systems Engineer,
GTL Ltd.
Ph. 7612929-3140

-----Original Message-----
From: Surya Narayana [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 30, 2002 10:37 PM
To: [EMAIL PROTECTED]
Subject: Re: JDBC

Hello Rama,
 
   You are using rs.next() twice. Thats why it is skipping the first record. Its enough to use rs.next() in while loop. no need of if loop.
 
Thanks & Regards,
 
Surya
 
 

Reply via email to