Hello,
Let's say I'm selecting a single column from many rows within a table using the SimpleJdbcTemplate. Is there an elegant way to get this as a List<String>? Usually I'd use a RowMapper but when it's just a string I wonder if there's a more elegant solution?
Code:public List<String> doSomething(long val) { return jdbc.query("SELECT CODE FROM MY_TABLE WHERE val >= ?", new ParameterizedRowMapper<String>() { public String mapRow(ResultSet rs, int arg1) throws SQLException { return rs.getString(1); } }, val); }


Reply With Quote