I think that his problem is related to the PreparedStatement. That he expected that he can use ".. WHERE foo IN (?)" and use a commaseparated
string in PreparedStatement#setString().
This is wrong.
You should create as many valueholders as values which you need in the IN clause. Suggestion: collect the values in a Collection (ArrayList? Set?) and pre-create as many valueholders as the Collection´s size and append it to the query string.