protected InputStream getAsciiStream() throws SQLException { return new ReaderInputStream( getCharacterStream() ); }
private InputStream getStream() throws SQLException { return getUnderlyingStream().getInputStream(); }
@Override public NClob createNClob(Reader reader, long length) { return NClobProxy.generateProxy( reader, length ); } }
/** * Generates a {@link java.sql.Clob} proxy using the string data. * * @param string The data to be wrapped as a {@link java.sql.Clob}. * * @return The generated proxy. */ public static NClob generateProxy(String string) { return (NClob) Proxy.newProxyInstance( getProxyClassLoader(), PROXY_INTERFACES, new ClobProxy( string ) ); }
@Override public Blob createBlob(byte[] bytes) { return BlobProxy.generateProxy( bytes ); }
@Override public Clob wrap(Clob clob) { if ( NClob.class.isInstance( clob ) ) { return wrap( (NClob) clob ); } else { return SerializableClobProxy.generateProxy( clob ); } }
/** * Create the basic contextual NCLOB reference. * * @return The created NCLOB reference. */ public NClob createNClob() { return lobCreationContext.execute( CREATE_NCLOB_CALLBACK ); }
/** * Generates a BlobImpl using byte data. * * @param bytes The data to be created as a Blob. * * @return The BlobProxy instance to represent this data. */ public static Blob generateProxy(byte[] bytes) { return new BlobProxy( bytes ); }
/** * Locate the column index corresponding to the given column name via the cache. * * @param columnName The column name to resolve into an index. * @return The column index corresponding to the given column name. * @throws SQLException if the ResultSet object does not contain columnName or a database access error occurs */ private Integer findColumn(String columnName) throws SQLException { return columnNameCache.getIndexForColumnName( columnName, rs ); }
@Override public ResultSet wrap(ResultSet resultSet, ColumnNameCache columnNameCache) { return ResultSetWrapperProxy.generateProxy( resultSet, columnNameCache, serviceRegistry ); } }
@Override public NClob wrap(NClob nclob) { return SerializableNClobProxy.generateProxy( nclob ); } }
protected Reader getCharacterStream() throws SQLException { return getUnderlyingStream().asReader(); }
/** * Determines the appropriate class loader to which the generated proxy * should be scoped. * * @return The class loader appropriate for proxy construction. */ public static ClassLoader getProxyClassLoader() { return SerializableClobProxy.getProxyClassLoader(); } }
@Override public Clob createClob(Reader reader, long length) { // IMPL NOTE : it is inefficient to use JDBC LOB locator creation to create a LOB // backed by a given stream. So just wrap the stream (which is what the NonContextualLobCreator does). return NonContextualLobCreator.INSTANCE.createClob( reader, length ); }
@Override public Blob createBlob(InputStream inputStream, long length) { // IMPL NOTE : it is inefficient to use JDBC LOB locator creation to create a LOB // backed by a given stream. So just wrap the stream (which is what the NonContextualLobCreator does). return NonContextualLobCreator.INSTANCE.createBlob( inputStream, length ); }
@Override public NClob createNClob(Reader reader, long length) { // IMPL NOTE : it is inefficient to use JDBC LOB locator creation to create a LOB // backed by a given stream. So just wrap the stream (which is what the NonContextualLobCreator does). return NonContextualLobCreator.INSTANCE.createNClob( reader, length ); }
/** * Constructor used to build {@link Blob} from a stream. * * @param stream The binary stream * @param length The length of the stream * @see #generateProxy(java.io.InputStream, long) */ private BlobProxy(InputStream stream, long length) { this.binaryStream = new StreamBackedBinaryStream( stream, length ); }
/** * Create the basic contextual BLOB reference. * * @return The created BLOB reference. */ public Blob createBlob() { return lobCreationContext.execute( CREATE_BLOB_CALLBACK ); }
/** * Generates a BlobImpl proxy using a given number of bytes from an InputStream. * * @param stream The input stream of bytes to be created as a Blob. * @param length The number of bytes from stream to be written to the Blob. * * @return The BlobProxy instance to represent this data. */ public static Blob generateProxy(InputStream stream, long length) { return new BlobProxy( stream, length ); }
/** * Create the basic contextual CLOB reference. * * @return The created CLOB reference. */ public Clob createClob() { return lobCreationContext.execute( CREATE_CLOB_CALLBACK ); }