the nullSafeSet method above doesn't check for nulls. Should be: <code> if (value == null) { st.setNull(index, Types.BINARY); } else { //setting BLOB here ... } </code>