Function deprecated for "Accessing Relational Data using JDBC with Spring"
gilles-phan opened this issue · comments
Gilles Phan commented
Hi,
Description:
For the page "Accessing Relational Data using JDBC with Spring", the method RelationalDataAccessApplication#run call to a deprecated function: jdbcTemplate.query(....
Details:
Deprecated function "query" in JdbcTemplate:
@Deprecated
@Override
public <T> List<T> query(String sql, @Nullable Object[] args, RowMapper<T> rowMapper) throws DataAccessException {
return result(query(sql, args, new RowMapperResultSetExtractor<>(rowMapper)));
}
The function to call
@Override
public <T> List<T> query(String sql, RowMapper<T> rowMapper, @Nullable Object... args) throws DataAccessException {
return result(query(sql, args, new RowMapperResultSetExtractor<>(rowMapper)));
}
Fix:
To fix it, we should simply invert the two last param (args and rowmapper).
Regards,
Gilles
dedicated commented
I see.
lehnharrt commented
@gilles-phan Thanks for solving my issue #28 this way!
Jay Bryant commented