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
import org.springframework.jdbc.core.RowCallbackHandler;
jdbcTemplate.query("select * from books", new RowCallbackHandler() {
public void processRow(ResultSet resultSet) throws SQLException {
while (resultSet.next()) {
String name = resultSet.getString("Name");
// process it
}
}
});
and calls resultSet.next() in while loop. But documentation about RowCallbackHandler#processRow clearly stated what it should not be done. Citing:
Implementations must implement this method to process each row of data in the ResultSet. This method should not call next() on the ResultSet; it is only supposed to extract values of the current row.
The text was updated successfully, but these errors were encountered:
https://mkyong.com/spring/spring-jdbctemplate-handle-large-resultset/ provides example code:
and calls
resultSet.next()
in while loop. But documentation about RowCallbackHandler#processRow clearly stated what it should not be done. Citing:The text was updated successfully, but these errors were encountered: