This question already has an answer here:
- PreparedStatement IN clause alternatives? 24 answers
I want to select all records form database using WHERE IN, using values form an array that I have. Is there a way to actually pass the array to the query?
I tried SELECT id FROM tag WHERE name IN "+myArray.toString()+"
. But, of course, it is destined to fail)
I could use preparedStatement, but number of values is always different and quite large - 5000 or so.
Or maybe I should take a different approach?