public User getUser(String username) {
String sql = "select username, password from config_user where username=?";
List<User> r = getJdbcTemplate().query(sql, new Object[]{username}, new RowMapper<User>() {
@Override
public User mapRow(ResultSet rs, int rowNum) throws SQLException {
return new User(rs.getString(1), rs.getString(2));
}
});
return !r.isEmpty() ? r.get(0) : null;
}