@Override public boolean useStreamForLobBinding() { if ( useStreamForLobBinding == null ) { useStreamForLobBinding = Environment.useStreamsForBinary() || getJdbcServices().getJdbcEnvironment().getDialect().useInputStreamToInsertBlob(); } return useStreamForLobBinding; }
public boolean useStreamForLobBinding() { return Environment.useStreamsForBinary(); }
public boolean useStreamForLobBinding() { return Environment.useStreamsForBinary(); }
public boolean useStreamForLobBinding() { return Environment.useStreamsForBinary(); }
public boolean useStreamForLobBinding() { return Environment.useStreamsForBinary(); }
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { if ( Environment.useStreamsForBinary() ) { st.setBinaryStream( index, new ByteArrayInputStream( (byte[]) value ), ( (byte[]) value ).length ); } else { st.setBytes( index, (byte[]) value ); } }
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { byte[] internalValue = toInternalFormat( value ); if ( Environment.useStreamsForBinary() ) { st.setBinaryStream( index, new ByteArrayInputStream( internalValue ), internalValue.length ); } else { st.setBytes( index, internalValue ); } }
public void set(PreparedStatement st, Object value, int index) throws HibernateException, SQLException { byte[] internalValue = toInternalFormat( value ); if ( Environment.useStreamsForBinary() ) { st.setBinaryStream( index, new ByteArrayInputStream( internalValue ), internalValue.length ); } else { st.setBytes( index, internalValue ); } }
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { if ( Environment.useStreamsForBinary() ) { InputStream inputStream = rs.getBinaryStream(name); if (inputStream==null) return null; // is this really necessary? ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048); byte[] buffer = new byte[2048]; try { while (true) { int amountRead = inputStream.read(buffer); if (amountRead == -1) { break; } outputStream.write(buffer, 0, amountRead); } inputStream.close(); outputStream.close(); } catch (IOException ioe) { throw new HibernateException( "IOException occurred reading a binary value", ioe ); } return outputStream.toByteArray(); } else { return rs.getBytes(name); } }
public void nullSafeSet(final PreparedStatement st, final Object value, final int index, final SessionImplementor session) throws HibernateException, SQLException { checkInitialization(); if (value == null) { st.setNull(index, sqlType); } else { final byte[] encryptedValue = this.encryptor.encrypt((byte[]) value); if (Environment.useStreamsForBinary()) { st.setBinaryStream( index, new ByteArrayInputStream(encryptedValue), encryptedValue.length); } else { st.setBytes(index, encryptedValue); } } }
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { if ( Environment.useStreamsForBinary() ) { InputStream inputStream = rs.getBinaryStream(name); if (inputStream==null) return toExternalFormat( null ); // is this really necessary? ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048); byte[] buffer = new byte[2048]; try { while (true) { int amountRead = inputStream.read(buffer); if (amountRead == -1) { break; } outputStream.write(buffer, 0, amountRead); } inputStream.close(); outputStream.close(); } catch (IOException ioe) { throw new HibernateException( "IOException occurred reading a binary value", ioe ); } return toExternalFormat( outputStream.toByteArray() ); } else { return toExternalFormat( rs.getBytes(name) ); } }
public Object get(ResultSet rs, String name) throws HibernateException, SQLException { if ( Environment.useStreamsForBinary() ) { InputStream inputStream = rs.getBinaryStream(name); if (inputStream==null) return toExternalFormat( null ); // is this really necessary? ByteArrayOutputStream outputStream = new ByteArrayOutputStream(2048); byte[] buffer = new byte[2048]; try { while (true) { int amountRead = inputStream.read(buffer); if (amountRead == -1) { break; } outputStream.write(buffer, 0, amountRead); } inputStream.close(); outputStream.close(); } catch (IOException ioe) { throw new HibernateException( "IOException occurred reading a binary value", ioe ); } return toExternalFormat( outputStream.toByteArray() ); } else { return toExternalFormat( rs.getBytes(name) ); } }
if (Environment.useStreamsForBinary()) {
@Override public boolean useStreamForLobBinding() { if ( useStreamForLobBinding == null ) { useStreamForLobBinding = Environment.useStreamsForBinary() || getJdbcServices().getJdbcEnvironment().getDialect().useInputStreamToInsertBlob(); } return useStreamForLobBinding; }
if ( Environment.useStreamsForBinary() ) { typeContributions.contributeSqlTypeDescriptor( BlobSqlDescriptor.STREAM_BINDING ); typeContributions.contributeSqlTypeDescriptor( ClobSqlDescriptor.STREAM_BINDING );