In JDBC I can use question marks for query parameters, like this:
\"SELECT * FROM users WHERE login = ?\"
and then
ps.setSt
Look here for an overview of available options. As far as I can tell you, everyone is dynamically generating the necessary number of placeholder characters (with some optimizations).
There's a setArray method in PreparedStatement, but sometimes using it is not feasible. You might give it a try though.
If Spring's JDBCTemplate is an option, you could use automatic collection expansion as described here.