I am getting below exception :
ERROR 1 --- [eduler_Worker-3] jdbc.sqltiming
: 123. PreparedStatement.setObject(1, {ids=[33925]})com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range. Caused by: org.springframework.dao.TransientDataAccessResourceException: PreparedStatementCallback; SQL [select * from tableA t1 WHERE t1.id IN (:ids)]; The index 1 is out of range.; nested exception is com.microsoft.sqlserver.jdbc.SQLServerException: The index 1 is out of range.
Below is the code:
@Override
@SneakyThrows
public void publish(List<Long> ids) {
val result = jdbcTemplate.queryForList("select * from tableA t1 WHERE t1.id IN (:ids)",ImmutableMap.of("ids", ids));
}
I am unable to understand that why is it trying to put at index 1 while I am using named parameter in the query. Please help