title: SqlServer PrepareStatement set parameters for SQL 'in(?)' clause
body: <p>I have a <code>sql</code> which looks like this:</p>
  
  <pre><code>SELECT * FROM T_TABLE WHERE ID IN(?)
  </code></pre>
  
  <p>I wanna to set parameters for <code>IN(?)</code> via <code>PrepareStatement</code>. I think the desired method would looked like this:</p>
  
  <pre><code>prepareStatement.setList(1,Arrays.asList("1","2","3"));
  </code></pre>
  
  <p>But I don't know which method should I use to achieve this. </p>
  
  <p>I have tried <code>setArray</code> method with the help from <a href="https://stackoverflow.com/questions/17842211/how-to-use-an-arraylist-as-a-prepared-statement-parameter">here</a> and I got these error messages.</p>
  
  <pre><code>java.sql.SQLFeatureNotSupportedException:
      at com.microsoft.sqlserver.jdbc.SQLServerConnection.createArrayOf(SQLServerConnection.java:2763)
      at com.newegg.ec.review.summary.dao.mssql.MSSQLReviewAccess.nextPage(MSSQLReviewAccess.java:165)
  </code></pre>
  
  <p>Does it mean that SqlService is not support <code>createArrayOf</code> method? And now, how can I achieve this? I don't like the way to join <code>sql</code> like this:</p>
  
  <pre><code>String sql = "SELECT * FROM T_TABLE WHERE ID IN("+in+")";
  </code></pre>
  
  <p>My code,</p>
  
  <pre><code>ps.setArray(1, conn.createArrayOf("VARCHAR",items.subList(1,9);
  </code></pre>
  
  <p>Any help would be appreciate.</p>
  
  <p>Regards.</p>