I am trying to write a conditional batch insert based on Java Parameters, for example
List<Object[]> params = new ArrayList();
params.add(new Object[]{1, 2, 3});
getSimpleJdbcTemplate.batchUpdate(
"INSERT INTO SomeTable( colA, colB, colC)" +
" VALUES(?, ?, ?)" +
" WHERE EXISTS ( // some condition )", params);
This obviously does not work, and the closest example I have found involves selecting the INSERT values from tables, instead of the List arguments, which is what I need. How can I reference the Object[] parameters as part of the INSERT values?
Thank you.