Here you can find the source of executeSQLCommand(Connection conn, String sql, byte[] blob)
public static void executeSQLCommand(Connection conn, String sql, byte[] blob) throws SQLException
//package com.java2s; //License from project: LGPL import java.sql.*; public class Main { public static void executeSQLCommand(Connection conn, String sql, byte[] blob) throws SQLException { PreparedStatement st = null; conn.setAutoCommit(true);// w w w. ja v a 2s . c om try { st = conn.prepareStatement(sql); st.setBytes(1, blob); st.executeUpdate(); } finally { if (st != null) st.close(); } } public static void executeSQLCommand(Connection conn, String sql) throws SQLException { Statement st = null; conn.setAutoCommit(true); try { st = conn.createStatement(); st.executeUpdate(sql); } finally { if (st != null) st.close(); } } }