Elegant alternative for constructing IN clause for SELECT?
843854Dec 10 2003 — edited Mar 22 2006I want to run a query like this:
SELECT place_id FROM ias.place WHERE uid_plc = ?
but for multiple values, like this:
SELECT place_id FROM ias.place WHERE uid_plc IN ('one', 'two', 'three')
The number of possible values for the IN clause is dynamic. Running the same PreparedStatement multiple times is very inefficient and constructing an IN clause seems inelegant. setBatch() and executeBatch() don't appear to work for a SELECT statement. Anyone have any other alternatives?
Thanks.
Eric