fix ResultSet not positioned properly, perhaps you need to call next.

This commit is contained in:
lCarLyl
2022-09-25 01:10:28 +03:00
parent c095591469
commit 8512b8ffe4

View File

@@ -56,7 +56,7 @@ public class JdbcTemplateImpl implements JdbcTemplate {
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
psp.process(preparedStatement);
try (ResultSet resultSet = preparedStatement.executeQuery()) {
return rse.extractData(resultSet);
return resultSet.next() ? rse.extractData(resultSet) : null;
}
} catch (SQLException e) {
throw throwDataAccessException(sql, e);