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
  • 40,041
  • 8
  • 39
  • 58
Bindumalini KK
  • 1,073
  • 3
  • 13
  • 24
  • 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. – Bindumalini KK 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