Here you can find the source of setValues(PreparedStatement preparedStatement, Object... values)
public static void setValues(PreparedStatement preparedStatement, Object... values) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.PreparedStatement; import java.sql.SQLException; import java.util.Collection; public class Main { /** /*from ww w . j a v a 2s.c o m*/ * See comments on {@link #preparePlaceHolders(int)} */ public static void setValues(PreparedStatement preparedStatement, Object... values) throws SQLException { for (int i = 0; i < values.length; i++) { preparedStatement.setObject(i + 1, values[i]); } } /** * See comments on {@link #preparePlaceHolders(int)} */ public static void setValues(PreparedStatement preparedStatement, Collection<?> values) throws SQLException { int i = 0; for (Object o : values) { preparedStatement.setObject(++i, o); } } }