Java While advance x loops

53 Views Asked by At

I have a progran in Java. I will illustrate it with a simplified example:

while( rowSet.next() ){
   //OPERATIONS
}

I know that my row set has length 50. I want to debug row number 48, but for it I dont want to go through the while 48 times.

Do you know how to position my debug in loop 48?

1

There are 1 best solutions below

0
On

Assuming that rowSet is a javax.sql.RowSet, you may use the absolute method to move to a given row number:

    rowSet.absolute(48);
    // OPERATIONS

The same is possible if rowSet is a java.sql.ResultSet.