Here you can find the source of fillInClause(PreparedStatement ps, int startIndex, Collection> clauses, int sqlType)
public static void fillInClause(PreparedStatement ps, int startIndex, Collection<?> clauses, int sqlType) throws SQLException
//package com.java2s; import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Collection; import java.util.Iterator; public class Main { public static void fillInClause(PreparedStatement ps, int startIndex, Collection<?> clauses, int sqlType) throws SQLException { fillInClause(ps, startIndex, clauses.size(), clauses.iterator(), sqlType); }/* w w w . ja va 2 s . c o m*/ public static void fillInClause(PreparedStatement ps, int startIndex, int maxSize, Iterator<?> clauses, int sqlType) throws SQLException { int counter = 0; for (; clauses.hasNext(); ++counter) { ps.setObject(startIndex++, clauses.next(), sqlType); if (counter >= maxSize) break; } for (int ii = maxSize; ii > counter; ii--) ps.setNull(startIndex++, sqlType); } }