Java tutorial
//package com.java2s; import java.util.ArrayList; public class Main { public static String convertListToStringForQuery(ArrayList<Integer> list) { String result = "("; for (int i = 0; i < list.size(); i++) { if (i != 0) { result = result + ","; } result = result + list.get(i).toString(); } result = result + ")"; return result; } }