Package oracle.sql

Class BLOB

  • All Implemented Interfaces:
    java.io.Serializable, java.sql.Blob, oracle.jdbc.internal.ACProxyable, oracle.jdbc.internal.OracleBlob, oracle.jdbc.internal.OracleConcreteProxy, oracle.jdbc.internal.OracleDatumWithConnection, oracle.jdbc.internal.OracleLargeObject<byte[]>, OracleBlob

    public class BLOB
    extends DatumWithConnection
    implements oracle.jdbc.internal.OracleBlob, oracle.jdbc.internal.OracleConcreteProxy
    Deprecated.
    Use java.sql.Blob interface for declaration instead of using concrete class oracle.sql.BLOB.
    This class implements the java.sql.Blob interface in JDBC 2.0. It provides the native implementation of the Blob methods. Use Blob interface for declaration instead of using concrete class oracle.sql.BLOB. java.sql.Blob has methods declared for all opertions. For Oracle specific methods use the interface OracleBlob.

    Obtaining Blob from ResultSet

    java.sql.Blob blob = resultSet.getBlob(...);

    Creating temporary Blob from factory method, java.sql.Connection#crateBlob()

    java.sql.Blob blob = connection.createBlob();
    See Also:
    Blob, OracleBlob, Connection.createBlob(), Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface oracle.jdbc.internal.OracleLargeObject

        oracle.jdbc.internal.OracleLargeObject.ArrayPrefetchData<T extends java.lang.Object>, oracle.jdbc.internal.OracleLargeObject.PrefetchData<T extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected BLOB()
      Deprecated.
       
      protected BLOB​(oracle.jdbc.driver.OracleBlob b)
      Deprecated.
      Call from empty lob static method
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      boolean canReadBasicLobDataInLocator()
      Deprecated.
      Can the lob data be read directly from the locator?
      void closeLob()
      Deprecated.
      Close a previously opened BLOB.
      static BLOB createTemporary​(java.sql.Connection conn, boolean cache, int _duration)
      Deprecated.
      Create a temporary blob.
      static BLOB empty_lob()
      Deprecated.
      use getEmptyBLOB instead
      void free()
      Deprecated.
      Free the resources the blob holds.
      java.util.concurrent.Flow.Publisher<java.lang.Void> freeAsyncOracle()
      Deprecated.
      Returns a Publisher that publishes the result of freeing the Blob object and the resources that it holds.
      void freeLOB()
      Deprecated.
       
      void freeTemporary()
      Deprecated.
      Free the contents and the locator of the temporary blob.
      static void freeTemporary​(BLOB temp_lob)
      Deprecated.
      Free the contents and the locator of the temporary blob.
      java.io.OutputStream getBinaryOutputStream()
      Deprecated.
      This method is deprecated.
      java.io.OutputStream getBinaryOutputStream​(long pos)
      Deprecated.
      This method is deprecated -- use setBinaryStream
      java.io.InputStream getBinaryStream()
      Deprecated.
      Implements the Blob interface function.
      java.io.InputStream getBinaryStream​(boolean isInternal)
      Deprecated.
      Implements the Blob interface function.
      java.io.InputStream getBinaryStream​(long pos)
      Deprecated.
      Read from the BLOB as a stream at the requested position.
      java.io.InputStream getBinaryStream​(long pos, long length)
      Deprecated.
      Return a binary stream beginning at the specified position and ofthe specified length.
      int getBufferSize()
      Deprecated.
      Oracle extension.
      byte[] getBytes​(long pos, int length)
      Deprecated.
      Implements the Blob interface function.
      int getBytes​(long pos, int length, byte[] buf)
      Deprecated.
      Oracle extension.
      int getChunkSize()
      Deprecated.
      Oracle extension.
      short getDuration()
      Deprecated.
      return the duration of a temporary LOB
      static short getDuration​(BLOB lob)
      Deprecated.
      return the duration of a temporary LOB
      static BLOB getEmptyBLOB()
      Deprecated.
      Return a empty lob.
      java.sql.Connection getJavaSqlConnection()
      Deprecated.
      Oracle extension Return the java.sql.Connection associated with the receiver.
      oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> getPrefetchData()
      Deprecated.
       
      int getPrefetchedDataSize()
      Deprecated.
       
      oracle.jdbc.driver.OracleBlob getTarget()
      Deprecated.
       
      boolean isConvertibleTo​(java.lang.Class<?> jClass)
      Deprecated.
      Oracle extension.
      boolean isEmptyLob()
      Deprecated.
      Return true if the lob locator points to a empty blob.
      boolean isFree()
      Deprecated.
       
      boolean isOpenLob()
      Deprecated.
      Check whether the BLOB is opened.
      boolean isSecureFile()
      Deprecated.
      Returns true if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).
      boolean isTemporary()
      Deprecated.
      Return true if the lob locator points to a temporary blob.
      static boolean isTemporary​(BLOB lob)
      Deprecated.
      Return true if the lob locator points to a temporary blob.
      long length()
      Deprecated.
      Implements the Blob interface function.
      void open​(int mode)
      Deprecated, for removal: This API element is subject to removal in a future version.
      The name of this method is anticipated to conflict with a future version of the JDBC Specification.
      void openLob​(int mode)
      Deprecated.
      Open a BLOB in the indicated mode.
      void openLob​(LargeObjectAccessMode mode)
      Deprecated.
      Public method using enum instead of int
      long position​(byte[] pattern, long start)
      Deprecated.
      Implements the Blob interface function.
      long position​(java.sql.Blob pattern, long start)
      Deprecated.
      Implements the Blob interface function.
      java.util.concurrent.Flow.Publisher<byte[]> publisherOracle​(long position, ErrorSet continueOnErrorSet)
      Deprecated.
      Returns a Publisher that publishes the content of this Blob beginning at the specified position.
      int putBytes​(long pos, byte[] bytes)
      Deprecated.
      This method is deprecated -- use setBytes
      int putBytes​(long pos, byte[] bytes, int length)
      Deprecated.
      This method is deprecated -- use setBytes
      java.io.OutputStream setBinaryStream​(long pos)
      Deprecated.
      JDBC 3.0 Retrieves a stream that can be used to write to the BLOB value that this Blob object represents.
      void setBytes​(byte[] locator)
      Deprecated.
      Sets datum value using a byte array.
      int setBytes​(long pos, byte[] bytes)
      Deprecated.
      JDBC 3.0 Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written.
      int setBytes​(long pos, byte[] bytes, int offset, int len)
      Deprecated.
      JDBC 3.0 Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written.
      void setPrefetchData​(oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> prefetchData)
      Deprecated.
       
      java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle​(long position, java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber, ErrorSet continueOnErrorSet)
      Deprecated.
      Returns a Subscriber that will append the published bytes to this Blob beginning at the specified position.
      java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle​(long position, ErrorSet continueOnErrorSet)
      Deprecated.
      Returns a Subscriber that will append the published bytes to this Blob beginning at the specified position.
      java.lang.Object toJdbc()
      Deprecated.
      Oracle extension.
      java.sql.SQLXML toSQLXML()
      Deprecated.
      Returns an object which impements java.sql.SQLXML with content take from this Clob.
      java.sql.SQLXML toSQLXML​(int csid)
      Deprecated.
      Returns an object which impements java.sql.SQLXML with content taken from this Blob.
      void trim​(long newlen)
      Deprecated.
      This method id deprecated -- use truncate
      void truncate​(long len)
      Deprecated.
      JDBC 3.0 Truncates the BLOB value that this Blob object represents to be len bytes in length.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface oracle.jdbc.internal.OracleBlob

        publisherOracle, subscriberOracle, subscriberOracle
      • Methods inherited from interface oracle.jdbc.internal.OracleDatumWithConnection

        bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, stringValue, timestampValue, timestampValue, timeValue, timeValue
    • Field Detail

      • MAX_CHUNK_SIZE

        public static final int MAX_CHUNK_SIZE
        Deprecated.
        1907584: Changed MAX_CHUNK_SIZE from 32512 to 32768. This was done to accommodate larger DB_BLOCK_SIZEs. Using 32512 would cause getBufferSize() to return 32512 for DB_BLOCK_SIZEs from 8192-32768. For these block sizes getBufferSize() should return getChunkSize(); not 32512. By using 32768 as the MAX_CHUNK_SIZE, getBufferSize() returns the correct chunk size. Please see bug for details.
        See Also:
        Constant Field Values
      • OLD_WRONG_DURATION_SESSION

        public static final int OLD_WRONG_DURATION_SESSION
        Deprecated.
        See Also:
        Constant Field Values
      • OLD_WRONG_DURATION_CALL

        public static final int OLD_WRONG_DURATION_CALL
        Deprecated.
        See Also:
        Constant Field Values
      • target

        protected oracle.jdbc.driver.OracleBlob target
        Deprecated.
    • Constructor Detail

      • BLOB

        protected BLOB()
        Deprecated.
      • BLOB

        protected BLOB​(oracle.jdbc.driver.OracleBlob b)
        Deprecated.
        Call from empty lob static method
    • Method Detail

      • getTarget

        public oracle.jdbc.driver.OracleBlob getTarget()
        Deprecated.
      • length

        public long length()
                    throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Return the length of the Binary Large OBject in bytes.
        Specified by:
        length in interface java.sql.Blob
        Returns:
        length of the BLOB in bytes
        Throws:
        java.sql.SQLException
      • publisherOracle

        public final java.util.concurrent.Flow.Publisher<byte[]> publisherOracle​(long position,
                                                                                 ErrorSet continueOnErrorSet)
                                                                          throws java.sql.SQLException
        Deprecated.
        Description copied from interface: OracleBlob
        Returns a Publisher that publishes the content of this Blob beginning at the specified position. The argument to each call to Subscriber.onNext will contain an implementation defined number of bytes.

        Calling any method of this Blob except isEmptyLob(), isSecureFile(), isTemporary(), or one defined by Object between the time this method is called and the time when the returned publisher terminates will block.

        The returned publisher terminates once all subscribers have received Subscriber.onComplete, received Subscriber.onError, or cancelled their subscription.

        Upon signalling demand to the returned Publisher, LOB read operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in the continueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next #resume().

        Specified by:
        publisherOracle in interface OracleBlob
        Parameters:
        position - the position at which to start reading from the BLOB value that this Blob object represents; The first position is 1
        continueOnErrorSet - Set of errors which do not cause subsequent operations to be aborted. Not null.
        Returns:
        a Publisher of the content of this Blob
        Throws:
        java.sql.SQLException - if a database error occurs, or if this method is called on a Blob that has been freed, or if position is less than 1
      • subscriberOracle

        public final java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle​(long position,
                                                                                   ErrorSet continueOnErrorSet)
                                                                            throws java.sql.SQLException
        Deprecated.
        Description copied from interface: OracleBlob
        Returns a Subscriber that will append the published bytes to this Blob beginning at the specified position.

        Calling any method of this Blob except isEmptyLob(), isSecureFile(), isTemporary(), or one defined by Object between the time this method is called and the time when the returned Subscriber terminates will block.

        The returned Subscriber terminates once Subscriber.onComplete is received, Subscriber.onError is received, or its subscription is cancelled.

        Upon receiving bytes from an upstream Publisher, LOB write operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in the continueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next #resume().

        Specified by:
        subscriberOracle in interface OracleBlob
        Parameters:
        position - the position at which to start reading from the BLOB value that this Blob object represents; The first position is 1
        continueOnErrorSet - Set of errors which do not cause subsequent operations to be aborted. Not null.
        Returns:
        a Subscriber that appends bytes to this Blob
        Throws:
        java.sql.SQLException - if a database error occurs, or if this method is called on a Blob that has been freed, or if position is less than 1
      • subscriberOracle

        public final java.util.concurrent.Flow.Subscriber<byte[]> subscriberOracle​(long position,
                                                                                   java.util.concurrent.Flow.Subscriber<java.lang.Long> outcomeSubscriber,
                                                                                   ErrorSet continueOnErrorSet)
                                                                            throws java.sql.SQLException
        Deprecated.
        Description copied from interface: OracleBlob
        Returns a Subscriber that will append the published bytes to this Blob beginning at the specified position.

        Calling any method of this Blob except isEmptyLob(), isSecureFile(), isTemporary(), or one defined by Object between the time this method is called and the time when the returned Subscriber terminates will block.

        The returned Subscriber terminates once Subscriber.onComplete is received, Subscriber.onError is received, or its subscription is cancelled.

        The outcome of writing published bytes to the BLOB value that this Blob object represents is published to the outcomeSubscriber:

        • The outcomeSubscriber receives an onNext signal each time a write to the BLOB value is successful. The number of bytes transferred in each successful write is the argument to each invocation of onNext.
        • The outcomeSubscriber receives an onComplete signal after the last published byte has been written successfully.
        • The outcomeSubscriber receives an onError signal with a SQLException if a failure occurs when writing published bytes.

        The outcomeSubscriber must signal demand in order to receive any of the signals listed above. If more than Flow.defaultBufferSize() writes have succeeded without demand from the outcomeSubscriber, then the returned subscriber will not signal further demand until the outcomeSubscriber has also signalled demand.

        The number of writes used to transfer published bytes to the BLOB value is implementation defined, and may be different from the number of byte arrays published to the returned Subscriber.

        Upon receiving bytes from an upstream Publisher, LOB write operations will enter into the execution pipeline of this LOB's connection. If an operation fails with an error not in the continueOnErrorSet, the pipeline will abort all subsequent asynchronous operations, up to the next #resume().

        Specified by:
        subscriberOracle in interface OracleBlob
        Parameters:
        position - the position at which to start reading from the BLOB value that this Blob object represents; The first position is 1
        outcomeSubscriber - a Subscriber of write outcomes.
        continueOnErrorSet - Set of errors which do not cause subsequent operations to be aborted. Not null.
        Returns:
        a Subscriber that appends bytes to this Blob
        Throws:
        java.sql.SQLException - if a database error occurs, or if this method is called on a Blob that has been freed, or if position is less than 1
      • freeAsyncOracle

        public final java.util.concurrent.Flow.Publisher<java.lang.Void> freeAsyncOracle()
                                                                                  throws java.sql.SQLException
        Deprecated.
        Returns a Publisher that publishes the result of freeing the Blob object and the resources that it holds. The object is invalid after the returned Publisher terminates with onComplete.

        After the returned Publisher terminates with onComplete, any attempt to invoke a method other than Blob.free() or freeAsyncOracle will result in an SQLException being thrown. Calling freeAsyncOracle on a Blob object that has already been freed is treated as a no-op.

        Calling any method of this Blob except isEmptyLob(), isSecureFile(), isTemporary(), or one defined by Object between the time this method is called and the time when the returned Subscriber terminates will block.

        The returned publisher terminates once all subscribers have received Subscriber.onComplete, received Subscriber.onError, or cancelled their subscription.

        The returned publisher will only emit onComplete or onError; No items are emitted to onNext.

        Implements the Reactive Extensions API by delegating to the ojiOracleBlob's implemenation.

        Specified by:
        freeAsyncOracle in interface OracleBlob
        Returns:
        a Publisher of the result of freeing this Blob
        Throws:
        java.sql.SQLException - if a database error occurs
      • getBytes

        public byte[] getBytes​(long pos,
                               int length)
                        throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Return a copy of the contents of the BLOB at the requested position.
        Specified by:
        getBytes in interface java.sql.Blob
        Parameters:
        pos - is the first byte of the blob to be extracted.
        length - is the number of consecutive bytes to be copied.
        Returns:
        a byte array containing a portion of the BLOB If the pos argument is larger than the length of the data the result is null. If the pos argument is less than the length of the data, but the sum of pos argument and the length is greater than the length of the data, the result will be smaller than the length requested. If the length is zero return and empty array
        Throws:
        java.sql.SQLException
      • getBinaryStream

        public java.io.InputStream getBinaryStream()
                                            throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Retrieve the entire BLOB as a stream.
        Specified by:
        getBinaryStream in interface java.sql.Blob
        Returns:
        a stream containing the BLOB data
        Throws:
        java.sql.SQLException
      • getBinaryStream

        public java.io.InputStream getBinaryStream​(boolean isInternal)
                                            throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Retrieve the entire BLOB as a stream.
        Returns:
        a stream containing the BLOB data
        Throws:
        java.sql.SQLException
      • position

        public long position​(byte[] pattern,
                             long start)
                      throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Determine the byte position at which the given byte pattern
        Specified by:
        position in interface java.sql.Blob
        Parameters:
        pattern - is the pattern to search for.
        start - is the position at which to begin searching.
        Returns:
        the position at which the pattern appears, else -1.
        Throws:
        java.sql.SQLException
      • position

        public long position​(java.sql.Blob pattern,
                             long start)
                      throws java.sql.SQLException
        Deprecated.
        Implements the Blob interface function. Determine the byte position at which the given pattern
        Specified by:
        position in interface java.sql.Blob
        Parameters:
        pattern - is the pattern to search for.
        start - is the position at which to begin searching.
        Returns:
        the position at which the pattern appears, else -1.
        Throws:
        java.sql.SQLException
      • getBytes

        public int getBytes​(long pos,
                            int length,
                            byte[] buf)
                     throws java.sql.SQLException
        Deprecated.
        Oracle extension. Copy the contents of the BLOB at the requested position to suppied buffer.
        Specified by:
        getBytes in interface OracleBlob
        Parameters:
        pos - is the first byte of the blob to be extracted.
        length - is the number of consecutive bytes to be copied.
        buf - is the buffer to had the extracted bytes.
        Returns:
        a byte array containing a portion of the BLOB
        Throws:
        java.sql.SQLException
      • putBytes

        public int putBytes​(long pos,
                            byte[] bytes)
                     throws java.sql.SQLException
        Deprecated.
        This method is deprecated -- use setBytes
        Oracle extension. Put data to the BLOB at the requested position.
        Specified by:
        putBytes in interface oracle.jdbc.internal.OracleBlob
        Parameters:
        pos - is the position data to be put.
        bytes - is the data to be written into BLOB.
        Returns:
        the number of bytes actually written.
        Throws:
        java.sql.SQLException
      • putBytes

        public int putBytes​(long pos,
                            byte[] bytes,
                            int length)
                     throws java.sql.SQLException
        Deprecated.
        This method is deprecated -- use setBytes
        Oracle extension. Put data to the BLOB at the requested position.
        Specified by:
        putBytes in interface oracle.jdbc.internal.OracleBlob
        Parameters:
        pos - is the position data to be put.
        bytes - is the data to be written into BLOB.
        length - is the length of the data to be written into BLOB.
        Returns:
        the number of bytes actually written.
        Throws:
        java.sql.SQLException
      • getBinaryOutputStream

        public java.io.OutputStream getBinaryOutputStream()
                                                   throws java.sql.SQLException
        Deprecated.
        This method is deprecated. Use setBinaryStream(1L).
        Oracle extension. Write to the BLOB from a stream.
        Specified by:
        getBinaryOutputStream in interface oracle.jdbc.internal.OracleBlob
        Returns:
        a output stream to write data to the BLOB
        Throws:
        java.sql.SQLException
      • getChunkSize

        public int getChunkSize()
                         throws java.sql.SQLException
        Deprecated.
        Oracle extension. Get database LOB storage chunk size in database.
        Specified by:
        getChunkSize in interface oracle.jdbc.internal.OracleBlob
        Returns:
        size in bytes
        Throws:
        java.sql.SQLException
      • getBufferSize

        public int getBufferSize()
                          throws java.sql.SQLException
        Deprecated.
        Oracle extension. Get ideal LOB db access buffer size.
        Specified by:
        getBufferSize in interface oracle.jdbc.internal.OracleBlob
        Returns:
        size in bytes
        Throws:
        java.sql.SQLException
      • empty_lob

        public static BLOB empty_lob()
                              throws java.sql.SQLException
        Deprecated.
        use getEmptyBLOB instead
        Return a empty lob. An empty lob is used initialize a LOB column/attribute. Note: an empty lob can not be read or written
        Returns:
        a empty lob
        Throws:
        java.sql.SQLException
        Since:
        8.1.7
      • getEmptyBLOB

        public static BLOB getEmptyBLOB()
                                 throws java.sql.SQLException
        Deprecated.
        Return a empty lob. An empty lob is used initialize a BLOB column/attribute. Note: an empty lob can not be read or written
        Returns:
        a empty lob
        Throws:
        java.sql.SQLException
        Since:
        10.2
      • isEmptyLob

        public boolean isEmptyLob()
                           throws java.sql.SQLException
        Deprecated.
        Return true if the lob locator points to a empty blob. False if it does not. This method supports only Blobs that are not returned from the database. For Blobs returned from the database, use length(), i.e. check for zero length.
        Specified by:
        isEmptyLob in interface OracleBlob
        Returns:
        true if the lob locator points to a empty blob. False if it does not.
        Throws:
        java.sql.SQLException
        Since:
        8.1.7
      • isSecureFile

        public boolean isSecureFile()
                             throws java.sql.SQLException
        Deprecated.
        Returns true if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).
        Specified by:
        isSecureFile in interface OracleBlob
        Returns:
        true if this is a SecureFile and false otherwise.
        Throws:
        java.sql.SQLException
      • getBinaryOutputStream

        public java.io.OutputStream getBinaryOutputStream​(long pos)
                                                   throws java.sql.SQLException
        Deprecated.
        This method is deprecated -- use setBinaryStream
        Write to the BLOB from a stream at the requested position.
        Specified by:
        getBinaryOutputStream in interface oracle.jdbc.internal.OracleBlob
        Parameters:
        pos - is the position data to be put.
        Returns:
        a output stream to write data to the BLOB
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • getBinaryStream

        public java.io.InputStream getBinaryStream​(long pos)
                                            throws java.sql.SQLException
        Deprecated.
        Read from the BLOB as a stream at the requested position.
        Specified by:
        getBinaryStream in interface OracleBlob
        Parameters:
        pos - is the position data to be read, should be greater than 0.
        Returns:
        a input stream to read data from the BLOB
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • trim

        public void trim​(long newlen)
                  throws java.sql.SQLException
        Deprecated.
        This method id deprecated -- use truncate
        Trim the value of the BLOB to the length you specify in the newlen parameter.
        Specified by:
        trim in interface oracle.jdbc.internal.OracleBlob
        Parameters:
        newlen - the new length of the BLOB.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • createTemporary

        public static BLOB createTemporary​(java.sql.Connection conn,
                                           boolean cache,
                                           int _duration)
                                    throws java.sql.SQLException
        Deprecated.
        Create a temporary blob.
        Parameters:
        cache - Specifies if LOB should be read into buffer cache or not.
        _duration - The duration of the temporary LOB. The following are valid values: DURATION_SESSION, DURATION_CALL.
        Returns:
        A temporary blob.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • freeTemporary

        public static void freeTemporary​(BLOB temp_lob)
                                  throws java.sql.SQLException
        Deprecated.
        Free the contents and the locator of the temporary blob.
        Parameters:
        temp_lob - A temporary blob to be freeed.
        Throws:
        java.sql.SQLException - if temp_lob is a permanent lob or temp_lob has already been freed.
        Since:
        8.2.0
      • isTemporary

        public static boolean isTemporary​(BLOB lob)
                                   throws java.sql.SQLException
        Deprecated.
        Return true if the lob locator points to a temporary blob. False if it does not.
        Parameters:
        lob - the blob to test.
        Returns:
        true if the lob locator points to a temporary blob. False if it does not.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • getDuration

        public static short getDuration​(BLOB lob)
                                 throws java.sql.SQLException
        Deprecated.
        return the duration of a temporary LOB
        Returns:
        the duration of a temporary LOB
        Throws:
        java.sql.SQLException
        Since:
        18.1
      • freeTemporary

        public void freeTemporary()
                           throws java.sql.SQLException
        Deprecated.
        Free the contents and the locator of the temporary blob.
        Specified by:
        freeTemporary in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
        Throws:
        java.sql.SQLException - if self is a permanent lob or self has already been freed.
        Since:
        8.2.0
      • isTemporary

        public boolean isTemporary()
                            throws java.sql.SQLException
        Deprecated.
        Return true if the lob locator points to a temporary blob. False if it does not.
        Specified by:
        isTemporary in interface OracleBlob
        Specified by:
        isTemporary in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
        Returns:
        true if the lob locator points to a temporary blob. False if it does not.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • getDuration

        public short getDuration()
                          throws java.sql.SQLException
        Deprecated.
        return the duration of a temporary LOB
        Specified by:
        getDuration in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
        Returns:
        the duration of a temporary LOB
        Throws:
        java.sql.SQLException
        Since:
        18.1
      • openLob

        public void openLob​(LargeObjectAccessMode mode)
                     throws java.sql.SQLException
        Deprecated.
        Public method using enum instead of int
        Specified by:
        openLob in interface OracleBlob
        Throws:
        java.sql.SQLException
        Since:
        23.5
      • open

        @Deprecated(since="23.5",
                    forRemoval=true)
        public void open​(int mode)
                  throws java.sql.SQLException
        Deprecated, for removal: This API element is subject to removal in a future version.
        The name of this method is anticipated to conflict with a future version of the JDBC Specification. This method will be removed in a future version of the Oracle JDBC Driver. Any calls to this method should be replaced with a call to openLob(int), which provides the exact same behavior.
        Open a BLOB in the indicated mode. Valid modes include MODE_READONLY, and MODE_READWRITE. It is an error to open the same LOB twice.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • openLob

        public void openLob​(int mode)
                     throws java.sql.SQLException
        Deprecated.
        Open a BLOB in the indicated mode. Valid modes include MODE_READONLY, and MODE_READWRITE. It is an error to open the same LOB twice.
        Throws:
        java.sql.SQLException
        Since:
        23.5
      • closeLob

        public void closeLob()
                      throws java.sql.SQLException
        Deprecated.
        Close a previously opened BLOB.
        Specified by:
        closeLob in interface OracleBlob
        Throws:
        java.sql.SQLException
        Since:
        23.5
      • isOpenLob

        public boolean isOpenLob()
                          throws java.sql.SQLException
        Deprecated.
        Check whether the BLOB is opened.
        Specified by:
        isOpenLob in interface OracleBlob
        Returns:
        true if the LOB is opened.
        Throws:
        java.sql.SQLException
        Since:
        23.5
      • setBytes

        public int setBytes​(long pos,
                            byte[] bytes)
                     throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Writes the given array of bytes to the BLOB value that this Blob object represents, starting at position pos, and returns the number of bytes written.
        Specified by:
        setBytes in interface java.sql.Blob
        Parameters:
        pos - the position in the BLOB object at which to start writing
        bytes - the array of bytes to be written to the BLOB value that this Blob object represents
        Returns:
        the number of bytes written
        Throws:
        java.sql.SQLException - if there is an error accessing the BLOB value
        Since:
        9.0.2
      • setBytes

        public int setBytes​(long pos,
                            byte[] bytes,
                            int offset,
                            int len)
                     throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Writes all or part of the given byte array to the BLOB value that this Blob object represents and returns the number of bytes written. Writing starts at position pos in the BLOB value; len bytes from the given byte array are written.
        Specified by:
        setBytes in interface java.sql.Blob
        Parameters:
        pos - the position in the BLOB object at which to start writing
        bytes - the array of bytes to be written to this BLOB object
        offset - the offset into the array bytes at which to start reading the bytes to be set
        len - the number of bytes to be written to the BLOB value from the array of bytes bytes
        Returns:
        the number of bytes written
        Throws:
        java.sql.SQLException - if there is an error accessing the BLOB value
        Since:
        9.0.2
      • setBinaryStream

        public java.io.OutputStream setBinaryStream​(long pos)
                                             throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Retrieves a stream that can be used to write to the BLOB value that this Blob object represents. The stream begins at position pos.
        Specified by:
        setBinaryStream in interface java.sql.Blob
        Parameters:
        pos - the position in the BLOB value at which to start writing
        Returns:
        a java.io.OutputStream object to which data can be written
        Throws:
        java.sql.SQLException - if there is an error accessing the BLOB value
        Since:
        9.0.2
        See Also:
        getBinaryStream()
      • truncate

        public void truncate​(long len)
                      throws java.sql.SQLException
        Deprecated.
        JDBC 3.0 Truncates the BLOB value that this Blob object represents to be len bytes in length.
        Specified by:
        truncate in interface java.sql.Blob
        Parameters:
        len - the length, in bytes, to which the BLOB value that this Blob object represents should be truncated
        Throws:
        java.sql.SQLException - if there is an error accessing the BLOB value
        Since:
        9.0.2
      • toJdbc

        public java.lang.Object toJdbc()
                                throws java.sql.SQLException
        Deprecated.
        Oracle extension. Convert this data object into its default Java object type.
        Specified by:
        toJdbc in interface oracle.jdbc.internal.OracleBlob
        Specified by:
        toJdbc in interface oracle.jdbc.internal.OracleDatumWithConnection
        Specified by:
        toJdbc in class Datum
        Returns:
        this object.
        Throws:
        java.sql.SQLException - if any of the lower layer code throws an exception.
      • isConvertibleTo

        public boolean isConvertibleTo​(java.lang.Class<?> jClass)
        Deprecated.
        Oracle extension. Test whether this data object can be converted to the specified Java data type.
        Specified by:
        isConvertibleTo in interface oracle.jdbc.internal.OracleBlob
        Specified by:
        isConvertibleTo in interface oracle.jdbc.internal.OracleDatumWithConnection
        Specified by:
        isConvertibleTo in class Datum
        Parameters:
        jClass - specifies the Java data type to test against.
        Returns:
        true if this data object is convertible to the specified Java class, and a corresponding xxxValue() method is available; otherwise, a false is returned.
      • getJavaSqlConnection

        public java.sql.Connection getJavaSqlConnection()
                                                 throws java.sql.SQLException
        Deprecated.
        Description copied from class: DatumWithConnection
        Oracle extension Return the java.sql.Connection associated with the receiver. Since 9.0.0 not all Oracle JDBC connection objects are assignment compatible with oracle.jdbc.driver.OracleConnection. If the connection is wrapped, return the outermost wrapper.
        Specified by:
        getJavaSqlConnection in interface oracle.jdbc.internal.OracleBlob
        Specified by:
        getJavaSqlConnection in interface oracle.jdbc.internal.OracleDatumWithConnection
        Overrides:
        getJavaSqlConnection in class DatumWithConnection
        Returns:
        the connection
        Throws:
        java.sql.SQLException - if an error occurs
      • setPrefetchData

        public final void setPrefetchData​(oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> prefetchData)
        Deprecated.
        Specified by:
        setPrefetchData in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
      • getPrefetchData

        public final oracle.jdbc.internal.OracleLargeObject.PrefetchData<byte[]> getPrefetchData()
        Deprecated.
        Specified by:
        getPrefetchData in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
      • getPrefetchedDataSize

        public final int getPrefetchedDataSize()
        Deprecated.
      • canReadBasicLobDataInLocator

        public boolean canReadBasicLobDataInLocator()
                                             throws java.sql.SQLException
        Deprecated.
        Can the lob data be read directly from the locator?
        Specified by:
        canReadBasicLobDataInLocator in interface oracle.jdbc.internal.OracleBlob
        Returns:
        True if we can; false otherwise.
        Throws:
        java.sql.SQLException
      • freeLOB

        public void freeLOB()
                     throws java.sql.SQLException
        Deprecated.
        Specified by:
        freeLOB in interface oracle.jdbc.internal.OracleLargeObject<byte[]>
        Throws:
        java.sql.SQLException
      • free

        public void free()
                  throws java.sql.SQLException
        Deprecated.
        Free the resources the blob holds.
        Specified by:
        free in interface java.sql.Blob
        Throws:
        java.sql.SQLException
        Since:
        11.0
      • getBinaryStream

        public java.io.InputStream getBinaryStream​(long pos,
                                                   long length)
                                            throws java.sql.SQLException
        Deprecated.
        Return a binary stream beginning at the specified position and ofthe specified length.
        Specified by:
        getBinaryStream in interface java.sql.Blob
        Parameters:
        pos - start position
        length - number of bytes in the result
        Throws:
        java.sql.SQLException - if pos is less than 1 or if pos is greater than the number of bytes in the Blob or if pos + length is greater than the number of bytes in the Blob.
        Since:
        11.0
      • setBytes

        public void setBytes​(byte[] locator)
        Deprecated.
        Description copied from class: Datum
        Sets datum value using a byte array. The byte array is copied.
        Specified by:
        setBytes in interface oracle.jdbc.internal.OracleDatumWithConnection
        Overrides:
        setBytes in class Datum
        Parameters:
        locator - byte array used to set the datum value
      • toSQLXML

        public java.sql.SQLXML toSQLXML()
                                 throws java.sql.SQLException
        Deprecated.
        Returns an object which impements java.sql.SQLXML with content take from this Clob.
        Specified by:
        toSQLXML in interface OracleBlob
        Returns:
        the new SQLXML object
        Throws:
        java.sql.SQLException
        Since:
        12.2
      • toSQLXML

        public java.sql.SQLXML toSQLXML​(int csid)
                                 throws java.sql.SQLException
        Deprecated.
        Returns an object which impements java.sql.SQLXML with content taken from this Blob.
        Specified by:
        toSQLXML in interface OracleBlob
        Returns:
        the new SQLXML object
        Throws:
        java.sql.SQLException
        Since:
        12.2
      • isFree

        public final boolean isFree()
        Deprecated.
        Specified by:
        isFree in interface oracle.jdbc.internal.OracleLargeObject<byte[]>