@Override public long length() throws SQLException { return binaryStream.getLength(); }
@Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, options ); if ( value instanceof BlobImplementer ) { try ( InputStream is = new CloseSuppressingInputStream( binaryStream.getInputStream() ) ) { st.setBinaryStream( index, is, binaryStream.getLength() ); } catch (IOException e) { // can't happen => ignore } } else { st.setBinaryStream( index, binaryStream.getInputStream(), binaryStream.getLength() ); } }
@Override protected void doBind(CallableStatement st, X value, String name, WrapperOptions options) throws SQLException { final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, options ); if ( value instanceof BlobImplementer ) { try ( InputStream is = new CloseSuppressingInputStream( binaryStream.getInputStream() ) ) { st.setBinaryStream( name, is, binaryStream.getLength() ); } catch (IOException e) { // can't happen => ignore } } else { st.setBinaryStream( name, binaryStream.getInputStream(), binaryStream.getLength() ); } } };
@Override public long length() throws SQLException { return binaryStream.getLength(); }
@Override protected void doBind( PreparedStatement st, int index, X value, ExecutionContext executionContext) throws SQLException { final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, executionContext.getSession() ); if ( value instanceof BlobImplementer ) { try ( InputStream is = new CloseSuppressingInputStream( binaryStream.getInputStream() ) ) { st.setBinaryStream( index, is, binaryStream.getLength() ); } catch (IOException e) { // can't happen => ignore } } else { st.setBinaryStream( index, binaryStream.getInputStream(), binaryStream.getLength() ); } }
@Override protected void doBind( CallableStatement st, String name, X value, ExecutionContext executionContext) throws SQLException { final BinaryStream binaryStream = javaTypeDescriptor.unwrap( value, BinaryStream.class, executionContext.getSession() ); if ( value instanceof BlobImplementer ) { try ( InputStream is = new CloseSuppressingInputStream( binaryStream.getInputStream() ) ) { st.setBinaryStream( name, is, binaryStream.getLength() ); } catch (IOException e) { // can't happen => ignore } } else { st.setBinaryStream( name, binaryStream.getInputStream(), binaryStream.getLength() ); } } };