Package oracle.jdbc

Interface OracleBlob

  • All Superinterfaces:
    java.sql.Blob
    All Known Implementing Classes:
    BLOB

    public interface OracleBlob
    extends java.sql.Blob
    This interface defines the Oracle extensions to the standard JDBC interface Blob .

    Generally any new code should avoid the direct use of the class BLOB. For variable declarations use the interface Blob or this interface as required. Instead of the static methods BLOB.createTemporary(java.sql.Connection, boolean, int) and BLOB.empty_lob() please use Connection.createBlob() and BLOB.getEmptyBLOB() respectively.

    Since:
    11.2.0.3
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Close a previously opened BLOB.
      java.io.InputStream getBinaryStream​(long pos)
      Read from the BLOB as a stream at the requested position.
      int getBytes​(long pos, int length, byte[] buf)
      Oracle extension.
      boolean isEmptyLob()
      Return true if the lob locator points to an empty blob.
      boolean isOpen()
      Check whether the BLOB is opened.
      boolean isSecureFile()
      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()
      Return true if the lob locator points to a temporary blob.
      void open​(LargeObjectAccessMode mode)
      Open a BLOB in the indicated mode.
      java.sql.SQLXML toSQLXML()
      Returns an object which implements java.sql.SQLXML with content take from this Clob.
      java.sql.SQLXML toSQLXML​(int csid)
      Returns an object which implements java.sql.SQLXML with content taken from this Blob.
      • Methods inherited from interface java.sql.Blob

        free, getBinaryStream, getBinaryStream, getBytes, length, position, position, setBinaryStream, setBytes, setBytes, truncate
    • Method Detail

      • open

        void open​(LargeObjectAccessMode mode)
           throws java.sql.SQLException
        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
      • close

        void close()
            throws java.sql.SQLException
        Close a previously opened BLOB.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • isOpen

        boolean isOpen()
                throws java.sql.SQLException
        Check whether the BLOB is opened.
        Returns:
        true if the LOB is opened.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • getBytes

        int getBytes​(long pos,
                     int length,
                     byte[] buf)
              throws java.sql.SQLException
        Oracle extension. Copy the contents of the BLOB at the requested position to the supplied buffer.
        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 have the extracted bytes.
        Returns:
        a byte array containing a portion of the BLOB
        Throws:
        java.sql.SQLException
      • isEmptyLob

        boolean isEmptyLob()
                    throws java.sql.SQLException
        Return true if the lob locator points to an empty blob. False if it does not.
        Returns:
        true if the lob locator points to an empty blob. False if it does not.
        Throws:
        java.sql.SQLException
        Since:
        8.1.7
      • isSecureFile

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

        java.io.InputStream getBinaryStream​(long pos)
                                     throws java.sql.SQLException
        Read from the BLOB as a stream at the requested position.
        Parameters:
        pos - is the position data to be read.
        Returns:
        an input stream to read data from the BLOB
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • isTemporary

        boolean isTemporary()
                     throws java.sql.SQLException
        Return true if the lob locator points to a temporary blob. False if it does not.
        Returns:
        true if the lob locator points to a temporary blob. False if it does not.
        Throws:
        java.sql.SQLException
        Since:
        8.2.0
      • toSQLXML

        java.sql.SQLXML toSQLXML()
                          throws java.sql.SQLException
        Returns an object which implements java.sql.SQLXML with content take from this Clob.
        Returns:
        the new SQLXML object
        Throws:
        java.sql.SQLException
        Since:
        12.2
      • toSQLXML

        java.sql.SQLXML toSQLXML​(int csid)
                          throws java.sql.SQLException
        Returns an object which implements java.sql.SQLXML with content taken from this Blob.
        Returns:
        the new SQLXML object
        Throws:
        java.sql.SQLException
        Since:
        12.2