Here you can find the source of executeUpdate(Connection conn, String sql, Object... parameters)
public static int executeUpdate(Connection conn, String sql, Object... parameters) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.*; public class Main { public static int executeUpdate(Connection conn, String sql, Object... parameters) throws SQLException { PreparedStatement stmt = null; int result = -1; try {//from ww w.jav a 2s .c o m stmt = conn.prepareStatement(sql); bindParams(stmt, parameters); result = stmt.executeUpdate(); } finally { if (stmt != null) { stmt.close(); } } return result; } private static void bindParams(PreparedStatement stmt, Object... parameters) throws SQLException { for (int i = 0; i < parameters.length; i++) { stmt.setObject(i + 1, parameters[i]); } } }