假定参数为: Int[] objs;
......
StringBuffer sql = new StringBuffer();
sql.append("select * from table where id in(");
for (int i=0; i<objs.length; i++)
(i == objs.length-1) ? sql.append("?)") : sql.append("?,");
PreparedStatement ps = conn.preparedStatement(sql.toString());
for (int i=1; i<=objs.length; i++)
ps.setInt(i, objs[i]);