How to execute query with IN clause in spring?
- by GK
I have following code :
try {
MapSqlParameterSource parameters = new MapSqlParameterSource();
parameters.addValue("ids", year);
return this.template.getJdbcOperations().query(
"SELECT * FROM INCOME WHERE PROVNUM=? AND FISCALDATE IN ( :ids )", this.rowMapper, parameters);
}catch (EmptyResultDataAccessException ex) {
return null;
}
But i am not able to send the value for PROVNUM. how to do that?
need help,
thanks.