Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions src/main/java/com/microsoft/sqlserver/jdbc/SQLServerResultSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -962,10 +962,19 @@ public boolean next() throws SQLServerException {

// For scrollable cursors, next() is just a special case of relative()
if (!isForwardOnly()) {
if (BEFORE_FIRST_ROW == currentRow)
moveFirst();
else
moveForward(1);
do {
if (BEFORE_FIRST_ROW == currentRow)
moveFirst();
else
moveForward(1);

// Only attempt rowDeleted() if result set is updatable.
try {
verifyResultSetIsUpdatable();
} catch (SQLServerException e) {
break;
}
} while (rowDeleted()); // repeat this if the row has been deleted beforehand, for scrollable & updatable resultsets.
boolean value = hasCurrentRow();
loggerExternal.exiting(getClassNameLogging(), "next", value);
return value;
Expand Down