I believe a simple toString()
will mostly do the trick:
String values[] = {"23","343","33","55","43"};
String inClause = values.toString();
//at this point inClause will look like "[23,343,33,55,43]"
//replace the brackets with parentheses
inClause = inClause.replace("[","(");
inClause = inClause.replace("]",")");
//now inClause will look like "(23,343,33,55,43)" so use it to construct your SELECT
String select = "select * from table_name where id in " + inClause;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…