Here you can find the source of toSQLIn(Collection
public static String toSQLIn(Collection<String> values)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static String toSQLIn(Collection<String> values) { if (values == null || values.isEmpty()) return null; String[] strvalues = new String[0]; strvalues = (String[]) values.toArray(new String[values.size()]); return toSQLIn(strvalues); }/* ww w . j ava2s . c o m*/ public static String toSQLIn(String[] values) { StringBuffer bf_sqlin = new StringBuffer(); if (values == null || values.length == 0) return null; int len = values.length; for (int i = 0; i < len; i++) { bf_sqlin = bf_sqlin.append(", '").append(values[i]).append("' "); } String str_sqlin = bf_sqlin.substring(1).toString(); return str_sqlin; } }