public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }
public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, new BlobImpl( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }
public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }
public void set(PreparedStatement st, Object value, int index, SessionImplementor session) throws SQLException { if ( value != null ) { byte[] toSet; toSet = toBytes( value ); if ( session.getFactory().getDialect().useInputStreamToInsertBlob() ) { st.setBinaryStream( index, new ByteArrayInputStream( toSet ), toSet.length ); } else { st.setBlob( index, Hibernate.getLobCreator( session ).createBlob( toSet ) ); } } else { st.setNull( index, sqlTypes( null )[0] ); } }