Here you can find the source of executeSetArgs(PreparedStatement stmt, Object... args)
public static <T> void executeSetArgs(PreparedStatement stmt, Object... args) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.PreparedStatement; import java.sql.SQLException; public class Main { public static <T> void executeSetArgs(PreparedStatement stmt, Object... args) throws SQLException { for (int i = 0; i < args.length; ++i) { stmt.setObject(i + 1, args[i]); }/*from w w w. j a va 2 s. c om*/ // Pad with nulls int n = stmt.getParameterMetaData().getParameterCount(); //System.out.println("x = " + n); for (int i = args.length; i < n; ++i) { stmt.setObject(i + 1, null); } //System.out.println("y = " + n); } }