Answers for "passing list ints paratmeter sql"

SQL
0

How to pass list as parameter in SQL query

private static String sqlFormatedList(List<String> list){
     StringBuilder sb = new StringBuilder();
     sb.append("('");
     for (String i : list){
       sb.append(i+"','");
     }
     sb.deleteCharAt(sb.length() -1);
     sb.deleteCharAt(sb.lastIndexOf(","));
     sb.append(")");
     return sb.toString();
    }
Posted by: Guest on July-01-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language