Here you can find the source of setBytes(PreparedStatement pstmt, int index, byte[] bytes)
public static void setBytes(PreparedStatement pstmt, int index, byte[] bytes) throws SQLException
//package com.java2s; //License from project: Open Source License import java.sql.PreparedStatement; import java.sql.SQLException; import java.sql.Types; public class Main { public static void setBytes(PreparedStatement pstmt, int index, byte[] bytes) throws SQLException { if (bytes != null) { pstmt.setBytes(index, bytes); } else {//from w w w . j ava 2s . c om pstmt.setNull(index, Types.BINARY); } } }