查询:

String sql = "SELECT " + Joiner.on(",").join(columns) + " FROM " + table + " WHERE 1=1";

写入:

String table="table";

String insertSql = String.format("INSERT INTO %s(%s) VALUES(%s)", 
table,Joiner.on(",").join(list), "值");

String sql=String.format(insertSql);

System.out.println(sql);

输出:INSERT INTO table(one,two,three,four) VALUES(值)