title: how to create comma separated string in single quotes from arraylist of string in JAVA
body: <p>I have requirement in Java to fire a query on MS SQL like</p>
  
  <pre><code>select * from customer 
  where customer.name in ('abc', 'xyz', ...,'pqr');
  </code></pre>
  
  <p>But I have this IN clause values in the form of ArrayList of String. For ex: the list look like {"abc","xyz",...,"pqr"}</p>
  
  <p>I created a Prepared Statement :</p>
  
  <pre><code> PreparedStatement pStmt = conn.prepareStatement(select * from customer 
      where customer.name in (?));
  String list= StringUtils.join(namesList, ",");
  pStmt.setString(1,list);
  rs = pStmt.executeQuery();
  </code></pre>
  
  <p>But the <strong>list</strong> is like <strong>"abc,xyz,..,pqr"</strong>, but I want it as <strong>"'abc','xyz',..,'pqr'"</strong>
  so that I can pass it to Prepares Statement.</p>
  
  <p>How to do it in JAva with out GUAVA helper libraries.</p>
  
  <p>Thanks in Advance!!</p>