feat(java): implement isBeforeFirst(), isAfterLast() in JDBC4ResultSet

This commit is contained in:
kimminseok
2025-10-07 14:15:10 +09:00
parent 80d11b75b1
commit fd61ddbd21
3 changed files with 56 additions and 2 deletions

View File

@@ -99,6 +99,16 @@ public final class TursoResultSet {
return lastStepResult != null && lastStepResult.isRow();
}
/** Checks whether the cursor is positioned after the last row. */
public boolean isPastLastRow() {
return pastLastRow;
}
/** Gets the current row number (0-based, 0 means before first row). */
public int getRow() {
return row;
}
/**
* Checks the status of the result set.
*

View File

@@ -413,12 +413,12 @@ public final class JDBC4ResultSet implements ResultSet, ResultSetMetaData {
@Override
public boolean isBeforeFirst() throws SQLException {
throw new UnsupportedOperationException("not implemented");
return resultSet.isOpen() && resultSet.getRow() == 0 && !resultSet.isPastLastRow();
}
@Override
public boolean isAfterLast() throws SQLException {
throw new UnsupportedOperationException("not implemented");
return resultSet.isOpen() && resultSet.isPastLastRow();
}
@Override