title: How to use arraylist as a parameter in IN clause of SQL
body: <p>I have a array list of integers . I want to use this list in the IN clause of SQL query. I tried to do the below, but i know it wont work. Can someone suggest a better way .</p>
  
  <pre><code>List&lt;Integer&gt; **plcList**  = new ArrayList&lt;Integer&gt;();
  String finalQuery = "
  select plc,direction,ROUND(AVG(CAST(speed as float)),2) as speed,COUNT(plc) as count,time_id 
  from processed 
  WHERE plc IN " + " " + "(**plcList**)"+ " " + "
  group by plc, direction, time_id";
  </code></pre>