public Reader getClobAsCharacterStream(ResultSet rs, int columnIndex) throws SQLException { Clob clob = rs.getClob(columnIndex); if (clob == null) { return null; } return clob.getCharacterStream(); }
/** * {@inheritDoc} */ @Override public Clob get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException { return rs.getClob(index); }
@Override public Reader getClobAsCharacterStream(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning CLOB as character stream"); if (this.wrapAsLob) { Clob clob = rs.getClob(columnIndex); return clob.getCharacterStream(); } else { return rs.getCharacterStream(columnIndex); } }
@Override public Clob fromResult(ResultSet results, int column) throws SQLException { return results.getClob(column); }
@Override public Clob getClob(int columnIndex) throws SQLException { return rs.getClob(columnIndex); }
@Override public Clob getClob(String columnLabel) throws SQLException { return rs.getClob(columnLabel); }
public String getClobAsString(ResultSet rs, int columnIndex) throws SQLException { Clob clob = rs.getClob(columnIndex); if (clob == null) { return null; } return clob.getSubString(1, (int) clob.length()); }
@Override @Nullable public String getClobAsString(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning CLOB as string"); if (this.wrapAsLob) { Clob clob = rs.getClob(columnIndex); return clob.getSubString(1, (int) clob.length()); } else { return rs.getString(columnIndex); } }
@Override public Clob getClob(String columnLabel) throws SQLException { try { return rs.getClob(columnLabel); } catch (Throwable t) { throw checkException(t); } }
public InputStream getClobAsAsciiStream(ResultSet rs, int columnIndex) throws SQLException { Clob clob = rs.getClob(columnIndex); if (clob == null) { return null; } return clob.getAsciiStream(); }
@Override public Clob getClob(int columnIndex) throws SQLException { try { return rs.getClob(columnIndex); } catch (Throwable t) { throw checkException(t); } }
@Override public InputStream getClobAsAsciiStream(ResultSet rs, int columnIndex) throws SQLException { logger.debug("Returning CLOB as ASCII stream"); if (this.wrapAsLob) { Clob clob = rs.getClob(columnIndex); return clob.getAsciiStream(); } else { return rs.getAsciiStream(columnIndex); } }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { return javaTypeDescriptor.wrap( rs.getClob( name ), options ); }
@Override public void run() throws Exception { rs.getClob(1); } });
@Override public void run() throws Exception { rs.getClob("id"); } });
public Object get(ResultSet rs, String colName) throws SQLException { Clob clob = rs.getClob(colName); if (clob == null) return null; File f = this.createTempFile(); Streams.writeAndClose(Streams.fileOutw(f), clob.getCharacterStream()); return new SimpleClob(f); }
public Object get(ResultSet rs, int columnIndex) throws SQLException { Clob clob = rs.getClob(columnIndex); if (clob == null) return null; File f = this.createTempFile(); Streams.writeAndClose(Streams.fileOutw(f), clob.getCharacterStream()); return new SimpleClob(f); }
@Override public Clob resultSet_getClob(ResultSetProxy resultSet, int columnIndex) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getClob(this, resultSet, columnIndex); } Clob clob = resultSet.getResultSetRaw().getClob(columnIndex); return wrap(resultSet.getStatementProxy(), clob); }
@Override public Clob resultSet_getClob(ResultSetProxy resultSet, String columnLabel) throws SQLException { if (this.pos < filterSize) { return nextFilter().resultSet_getClob(this, resultSet, columnLabel); } Clob clob = resultSet.getResultSetRaw().getClob(columnLabel); return wrap(resultSet.getStatementProxy(), clob); }
@Override protected X doExtract(ResultSet rs, String name, WrapperOptions options) throws SQLException { Clob rsClob; if ( HANAClobTypeDescriptor.this.useUnicodeStringTypes ) { rsClob = rs.getNClob( name ); } else { rsClob = rs.getClob( name ); } if ( rsClob == null || rsClob.length() < HANAClobTypeDescriptor.this.maxLobPrefetchSize ) { return javaTypeDescriptor.wrap( rsClob, options ); } Clob clob = new MaterializedNClob( DataHelper.extractString( rsClob ) ); return javaTypeDescriptor.wrap( clob, options ); }