You can use the following way
String inSql = String.join(",", Collections.nCopies(ids.size(), "?"));
List<Account> result = jdbcTemplate.query(
String.format("SELECT ID, NAME FROM ACCOUNT WHERE STATUS = 'OK' AND ID IN (%s)", inSql),
ids.toArray(),
(rs, rowNum) -> new Account(rs.getInt("ID"), rs.getString("NAME")));
CLICK HERE to find out more related problems solutions.