Fix: Invalid operation for forward only resultset : first
Use ResultSet#next() insteadof using ResultSet#first(). As mentioned in Javadoc for ResultSet#first(): This method is called on a closed result set or the result set type is TYPE_FORWARD_ONLY exception SQLFeatureNotSupportedException if the JDBC driver does not support this method. Bug: Issue 10018 Change-Id: Ica6c72f2d489520ae367b608867f5b8c6a5ef276
This commit is contained in:
@@ -60,7 +60,7 @@ public class Schema_151 extends SchemaVersion {
|
||||
PreparedStatement addedOnRetrieval, AccountGroup.Id groupId) throws SQLException {
|
||||
addedOnRetrieval.setInt(1, groupId.get());
|
||||
try (ResultSet resultSet = addedOnRetrieval.executeQuery()) {
|
||||
if (resultSet.first()) {
|
||||
if (resultSet.next()) {
|
||||
return Optional.of(resultSet.getTimestamp(1));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class Schema_87 extends SchemaVersion {
|
||||
PreparedStatement uuidRetrieval, AccountGroup.Id id) throws SQLException {
|
||||
uuidRetrieval.setInt(1, id.get());
|
||||
try (ResultSet uuidResults = uuidRetrieval.executeQuery()) {
|
||||
if (uuidResults.first()) {
|
||||
if (uuidResults.next()) {
|
||||
Optional.of(new AccountGroup.UUID(uuidResults.getString(1)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user