You might use NamedParameterJdbcTemplate which supports named parameter binding (using :foo
instead of ?
) and collection parameter expansion (expanding :foo
to ?, ?, ?
). Then you can use:
jdbcTemplate.queryForObject("SELECT * FROM stored_procedure({:notes})",
Collections.singletonMap("notes", notes));
I don't think PostgreSQL JDBC driver supports array parameter types (i.e. you can not bind array to a single ?
).