I connected to database in my java program. I have a situation where I need to pass filter values dynamically, filter values depends of others parts of java code
Example query: select * from table1 where id in (dynamic and multiple)?
How to pass these dynamic and multiple values using Java connection.
String query = "select * from emp where id in(##)";
create the in clause like this
String inClause = "'abcd', 'cedf', '1234'"; String finalQuery = query.replace("##", inClause );