What is the best approach using JDBC for parameterizing an IN clause?

Posted by Uri on Stack Overflow See other posts from Stack Overflow or by Uri
Published on 2010-05-18T21:18:46Z Indexed on 2010/05/18 21:20 UTC
Read the original article Hit count: 204

Filed under:
|
|
|

Say that I have a query of the form

SELECT * FROM MYTABLE WHERE MYCOL in (?)

And I want to parameterize the arguments to in.

Is there a straightforward way to do this in Java with JDBC, in a way that could work on multiple databases without modifying the SQL itself?

The closest question I've found had to do with C#, I'm wondering if there is something different for Java/JDBC.

© Stack Overflow or respective owner

Related posts about java

Related posts about jdbc