public InputStream getBlobAsBinaryStream(ResultSet rs, int columnIndex) throws SQLException { Blob blob = rs.getBlob(columnIndex); if (blob == null) { return null; } return blob.getBinaryStream(); }
/** * {@inheritDoc} */ @Override public Blob get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getBlob(index); }
@Override public Blob fromResult(ResultSet results, int column) throws SQLException { return results.getBlob(column); }
@Override @Nullable public InputStream getBlobAsBinaryStream(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning BLOB as binary stream"); if (this.wrapAsLob) { Blob blob = rs.getBlob(columnIndex); return blob.getBinaryStream(); } else { return rs.getBinaryStream(columnIndex); } }
public byte[] getBlobAsBytes(ResultSet rs, int columnIndex) throws SQLException { Blob blob = rs.getBlob(columnIndex); if (blob == null) { return null; } return blob.getBytes(1, (int) blob.length()); }
@Override public Blob getBlob(int columnIndex) throws SQLException { return rs.getBlob(columnIndex); }
@Override @Nullable public byte[] getBlobAsBytes(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning BLOB as bytes"); if (this.wrapAsLob) { Blob blob = rs.getBlob(columnIndex); return blob.getBytes(1, (int) blob.length()); } else { return rs.getBytes(columnIndex); } }
@Override public Blob getBlob(int columnIndex) throws SQLException { try { return rs.getBlob(columnIndex); } catch (Throwable t) { throw checkException(t); } }
@Override public Blob getBlob(String columnLabel) throws SQLException { try { return rs.getBlob(columnLabel); } catch (Throwable t) { throw checkException(t); } }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { return javaTypeDescriptor.wrap( rs.getBlob( name ), options ); }
private InputStream getInputStream(String resPath, ResultSet rs) throws SQLException, IOException { if (rs == null) { return null; } Blob blob = rs.getBlob(META_TABLE_CONTENT); if (blob == null || blob.length() == 0) { return openPushdown(resPath); // empty bytes is pushdown indicator } else { return blob.getBinaryStream(); } }
@Override public void run() throws Exception { rs.getBlob(1); } });
@Override public void run() throws Exception { rs.getBlob("id"); } });
private void printValue(ResultSet rs, int col, PrintStream out) throws SQLException { if (rawBlobs && rs.getMetaData().getColumnType(col) == Types.BLOB) { Blob blob = rs.getBlob(col); if (blob != null) { new StreamPumper(rs.getBlob(col).getBinaryStream(), out).run(); } } else { out.print(maybeQuote(rs.getString(col))); } }
@Override public Blob resultSet_getBlob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getBlob(this, resultSet, columnIndex); } return resultSet.getResultSetRaw().getBlob(columnIndex); }
@Override public Blob resultSet_getBlob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getBlob(this, resultSet, columnLabel); } return resultSet.getResultSetRaw().getBlob(columnLabel); }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { Blob rsBlob = rs.getBlob( name ); if ( rsBlob == null || rsBlob.length() < HANAStreamBlobTypeDescriptor.this.maxLobPrefetchSize ) { return javaTypeDescriptor.wrap( rsBlob, options ); } Blob blob = new MaterializedBlob( DataHelper.extractBytes( rsBlob.getBinaryStream() ) ); return javaTypeDescriptor.wrap( blob, options ); }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { Blob rsBlob = rs.getBlob( name ); if ( rsBlob == null || rsBlob.length() < HANABlobTypeDescriptor.this.maxLobPrefetchSize ) { return javaTypeDescriptor.wrap( rsBlob, options ); } Blob blob = new MaterializedBlob( DataHelper.extractBytes( rsBlob.getBinaryStream() ) ); return javaTypeDescriptor.wrap( blob, options ); }
public Object get(ResultSet rs, String colName) throws SQLException { Blob blob = rs.getBlob(colName); if (blob == null) return null; File f = this.createTempFile(); Files.write(f, blob.getBinaryStream()); return new SimpleBlob(f); }
public Object get(ResultSet rs, int columnIndex) throws SQLException { Blob blob = rs.getBlob(columnIndex); if (blob == null) return null; File f = this.createTempFile(); Files.write(f, blob.getBinaryStream()); return new SimpleBlob(f); }