Thursday, 5. March 2009 21:14
Well, more for myself to remember if I ever need this again (although I don’t think I won’t remember this… )
Ever had the problem with Java, JDBC and PreparedStatements to do this:
SELECT * FROM TESTTABLE WHERE ID IN (?)
And now you want to use PreparedStatements via JDBC?
So here is what you need to do (and believe me it is not quite as simple as you think…)
First try on your Java Code, as it seems to be obvious to use the setArray-Method of JDBC. But mention the Query-Part after the IN-Clause.