fix ResultSet not positioned properly, perhaps you need to call next.
This commit is contained in:
@@ -56,7 +56,7 @@ public class JdbcTemplateImpl implements JdbcTemplate {
|
|||||||
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
|
PreparedStatement preparedStatement = connection.prepareStatement(sql)) {
|
||||||
psp.process(preparedStatement);
|
psp.process(preparedStatement);
|
||||||
try (ResultSet resultSet = preparedStatement.executeQuery()) {
|
try (ResultSet resultSet = preparedStatement.executeQuery()) {
|
||||||
return rse.extractData(resultSet);
|
return resultSet.next() ? rse.extractData(resultSet) : null;
|
||||||
}
|
}
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw throwDataAccessException(sql, e);
|
throw throwDataAccessException(sql, e);
|
||||||
|
|||||||
Reference in New Issue
Block a user