posted 22 years ago
Hi All,
I am using a ResultSet to retriev data from database. After the action i want to know whether any record is present or not.
What i have done is I have used
if(Rs.next())
{
out.println("present")
}
The problem is My result set returns only one record and if i say rs.next() to check the presence of any record the pointer will move to first record.
Next if i have to take the record to some variable i use
while (rs.next())
{
temp=rs.getString("name");
}
here i am getting an exception as because the pointer has already moved and there is no record.
So how to check for presence of any record in a resultset without using .next() method.
it would be greate if any body tells the solution for this.
thanks in advance
santosh