class Teste2 {
for (int i = 0; i < valores.length; i++) {
novoArray[i] = "('" + chave + "', '" + valores[i] + "')";
}
return novoArray;
}
public static void main
(String[] args
) { String[] arrayOriginal
= {"10",
"20",
"30",
"40"}; String[] resultados
= juntarTodasAsSQLs
(chave, arrayOriginal
);
}
}
}
Y2xhc3MgVGVzdGUyIHsKCiAgICBwdWJsaWMgc3RhdGljIFN0cmluZ1tdIGp1bnRhclRvZGFzQXNTUUxzKFN0cmluZyBjaGF2ZSwgU3RyaW5nW10gdmFsb3JlcykgewogICAgICAgIFN0cmluZ1tdIG5vdm9BcnJheSA9IG5ldyBTdHJpbmdbdmFsb3Jlcy5sZW5ndGhdOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgdmFsb3Jlcy5sZW5ndGg7IGkrKykgewogICAgICAgICAgICBub3ZvQXJyYXlbaV0gPSAiKCciICsgY2hhdmUgKyAiJywgJyIgKyB2YWxvcmVzW2ldICsgIicpIjsKICAgICAgICB9CiAgICAgICAgcmV0dXJuIG5vdm9BcnJheTsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgU3RyaW5nIGNoYXZlID0gIjk5OSI7CiAgICAgICAgU3RyaW5nW10gYXJyYXlPcmlnaW5hbCA9IHsiMTAiLCAiMjAiLCAiMzAiLCAiNDAifTsKICAgICAgICBTdHJpbmdbXSByZXN1bHRhZG9zID0ganVudGFyVG9kYXNBc1NRTHMoY2hhdmUsIGFycmF5T3JpZ2luYWwpOwoKICAgICAgICBmb3IgKFN0cmluZyByIDogcmVzdWx0YWRvcykgewogICAgICAgICAgICBTeXN0ZW0ub3V0LnByaW50bG4ocik7CiAgICAgICAgfQogICAgfQp9