0

How can we use a Java array values in the IN clause of an SQL statement?

Example :

String[] names={"Abc","Bac","lol"};
String query= select * from Table1 where name in (using the Names array as a look up)
jarlh
  • 42,561
  • 8
  • 45
  • 63
Eternal_Explorer
  • 1,119
  • 3
  • 14
  • 26
  • It doesn't depend on Java directly. It depends on the library you're using to interact with your database. What database are you using and what drivers/libraries are you using in Java? – MatBailie Nov 20 '18 at 11:50
  • @MatBailie Yeah agree.I added it for the better semantical clarity of the Language I am using. I am using Oracle 11g. – Eternal_Explorer Nov 20 '18 at 12:30
  • You still haven't said what java libraries you are using to connect to Oracle. It's those libraries that facilitate this, or not... – MatBailie Nov 20 '18 at 12:32

0 Answers0