Let's say I have a query "SELECT * FROM TABLE"
Then using a recordset, I retrieve the values.
CODE
try {
while(rst.next())
{
//Example
System.out.println(rst.getString(2));
}
} catch (Exception e) {
System.out.println(e);
}
Let's say I have table values:
ID NAME
-- ------
1 A
2 B
3 C
4 D
The while loop starts to display starting from NAME = 'A'
then while the loop is running, and I delete let's say, where NAME='C'.
After displaying the first 2 records, when the loop reaches the entry where NAME='C', it is unable to find that record in the database and returns the "Before start of result set" exception.
My question is, how do I set it to move on to the next record without any exceptions?
This post has been edited by mvtan: Mar 31 2006, 11:23 AM