This is an old question, but for anyone facing a similar issue, here's what the Spring JDBC documentation clarifies:
The query method actually comes in two versions:
public void query(String sql, RowCallbackHandler rch): The rch parameter is a callback that processes each row one at a time. You don't need to call rs.next() manually to move to the next row—Spring handles that for you.
public T query(String sql, ResultSetExtractor rse): The rse parameter is a callback that extracts all rows of results at once. In this case, you'd process the entire ResultSet.
If you're using a lambda expression for the second argument, the JDK may select one of these methods automatically, depending on whether you assign the query result to a variable or not.