Simplified for illustrative purposes:
String[] filter = {"foo", "bar"};
String sql = "SELECT * FROM table WHERE column IN ?";
declareParameter(new SqlParameter(Types.ARRAY));
This doesn’t work when I execute it (I get a java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid parameter binding(s). exception.
JDBC doesn’t support this kind of query officially and SQL Server doesn’t either as far as I know. This topic has been discussed on SO many times and several workarounds have been proposed:
You can probably find many more as it is indeed a very relevant yet still open topic.