Skip to content

Instantly share code, notes, and snippets.

@avshabanov
Created April 11, 2015 21:51
Show Gist options
  • Save avshabanov/d27f329f3e6d98dce40f to your computer and use it in GitHub Desktop.
Save avshabanov/d27f329f3e6d98dce40f to your computer and use it in GitHub Desktop.
final Object o1 = jdbcOperations.query("SELECT book_id, series_id, pos FROM book_series", new RowMapper<Object>() {
@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
final Map<String, Object> result = new HashMap<String, Object>();
result.put("book_id", rs.getLong("book_id"));
result.put("series_id", rs.getLong("series_id"));
result.put("pos", rs.getInt("pos"));
return result;
}
});
final Object o2 = jdbcOperations.query("SELECT book_id, external_id_type, external_id FROM book_external_id", new RowMapper<Object>() {
@Override
public Object mapRow(ResultSet rs, int i) throws SQLException {
final Map<String, Object> result = new HashMap<>();
result.put("book_id", rs.getLong("book_id"));
result.put("external_id_type", rs.getLong("external_id_type"));
result.put("external_id", rs.getString("external_id"));
return result;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment