jpdeveloper
jpdeveloper

Reputation: 9

Java While advance x loops

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?

Upvotes: -3

Views: 43

Answers (1)

Anonymous
Anonymous

Reputation: 86232

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.

Upvotes: 0

Related Questions