You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
isAfterLast fails with a null pointer exception where as I think it should return true on the last call (or, worst case, fail with an SQLFeatureNotSupportedException).
Tested on Firebird 3, Jaybird jaybird-jdk18:3.0.12.
Also tested same code on a Postgres DB (query changed appropriately), and it works as expected.
void quickTest() throws SQLException {
val connection = DriverManager.getConnection(jdbcUrl, user, password);
val statement = connection.createStatement();
val resultSet = statement.executeQuery("select * from RDB$DATABASE");
while (resultSet.next()) {
System.out.println("isAfterLast: " + resultSet.isAfterLast());
System.out.println("RDB$RELATION_ID: " + resultSet.getInt("RDB$RELATION_ID"));
}
System.out.println("isAfterLast: " + resultSet.isAfterLast()); // <-- This one raised a null pointer exception
}
The text was updated successfully, but these errors were encountered:
The problem is that in auto-commit mode, fetching to the end of the result set will close the result set, which then sets some internal fields null. This should obviously not result in an NPE, but the change I'm going to make will result in a SQLException with text "The result set is closed", and not in isAfterLast() reporting true in auto-commit mode.
This was an explicit requirement in JDBC 3.0 (section 10.1). In JDBC 4.0 this was changed, but closing the result set after fetching the last row (in auto-commit mode) still complies with section 15.2.5 of JDBC 4.3. I will create a separate ticket to see if this should be changed to allow for more flexibility.
Given Jaybird 3.0 is end-of-life, this will only be changed in Jaybird 4 and 5.
isAfterLast fails with a null pointer exception where as I think it should return true on the last call (or, worst case, fail with an SQLFeatureNotSupportedException).
Tested on Firebird 3, Jaybird jaybird-jdk18:3.0.12.
Also tested same code on a Postgres DB (query changed appropriately), and it works as expected.
The text was updated successfully, but these errors were encountered: