Class LargeObjectManager

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int READ
      This mode indicates we want to read an object.
      static int READWRITE
      This mode is the default.
      static int WRITE
      This mode indicates we want to write to an object.
    • Field Detail

      • WRITE

        public static final int WRITE
        This mode indicates we want to write to an object.
        See Also:
        Constant Field Values
      • READ

        public static final int READ
        This mode indicates we want to read an object.
        See Also:
        Constant Field Values
      • READWRITE

        public static final int READWRITE
        This mode is the default. It indicates we want read and write access to a large object.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LargeObjectManager

        public LargeObjectManager​(BaseConnection conn)
                           throws SQLException

        Constructs the LargeObject API.

        Important Notice
        This method should only be called by BaseConnection

        There should only be one LargeObjectManager per Connection. The BaseConnection class keeps track of the various extension API's and it's advised you use those to gain access, and not going direct.

        Parameters:
        conn - connection
        Throws:
        SQLException - if something wrong happens
    • Method Detail

      • open

        @Deprecated
        public LargeObject open​(int oid)
                         throws SQLException
        Deprecated.
        As of 8.3, replaced by open(long)
        This opens an existing large object, based on its OID. This method assumes that READ and WRITE access is required (the default).
        Parameters:
        oid - of large object
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(int oid,
                                boolean commitOnClose)
                         throws SQLException
        This opens an existing large object, same as previous method, but commits the transaction on close if asked. This is useful when the LOB is returned to a caller which won't take care of transactions by itself.
        Parameters:
        oid - of large object
        commitOnClose - commit the transaction when this LOB will be closed
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(long oid)
                         throws SQLException
        This opens an existing large object, based on its OID. This method assumes that READ and WRITE access is required (the default).
        Parameters:
        oid - of large object
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(long oid,
                                boolean commitOnClose)
                         throws SQLException
        This opens an existing large object, same as previous method, but commits the transaction on close if asked.
        Parameters:
        oid - of large object
        commitOnClose - commit the transaction when this LOB will be closed
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        @Deprecated
        public LargeObject open​(int oid,
                                int mode)
                         throws SQLException
        Deprecated.
        As of 8.3, replaced by open(long, int)
        This opens an existing large object, based on its OID.
        Parameters:
        oid - of large object
        mode - mode of open
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(int oid,
                                int mode,
                                boolean commitOnClose)
                         throws SQLException
        This opens an existing large object, same as previous method, but commits the transaction on close if asked.
        Parameters:
        oid - of large object
        mode - mode of open
        commitOnClose - commit the transaction when this LOB will be closed
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(long oid,
                                int mode)
                         throws SQLException
        This opens an existing large object, based on its OID.
        Parameters:
        oid - of large object
        mode - mode of open
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • open

        public LargeObject open​(long oid,
                                int mode,
                                boolean commitOnClose)
                         throws SQLException
        This opens an existing large object, based on its OID.
        Parameters:
        oid - of large object
        mode - mode of open
        commitOnClose - commit the transaction when this LOB will be closed
        Returns:
        LargeObject instance providing access to the object
        Throws:
        SQLException - on error
      • create

        @Deprecated
        public int create()
                   throws SQLException
        Deprecated.
        As of 8.3, replaced by createLO()

        This creates a large object, returning its OID.

        It defaults to READWRITE for the new object's attributes.

        Returns:
        oid of new object
        Throws:
        SQLException - on error
      • createLO

        public long createLO()
                      throws SQLException

        This creates a large object, returning its OID.

        It defaults to READWRITE for the new object's attributes.

        Returns:
        oid of new object
        Throws:
        SQLException - if something wrong happens
      • createLO

        public long createLO​(int mode)
                      throws SQLException
        This creates a large object, returning its OID.
        Parameters:
        mode - a bitmask describing different attributes of the new object
        Returns:
        oid of new object
        Throws:
        SQLException - on error
      • create

        @Deprecated
        public int create​(int mode)
                   throws SQLException
        Deprecated.
        As of 8.3, replaced by createLO(int)
        This creates a large object, returning its OID.
        Parameters:
        mode - a bitmask describing different attributes of the new object
        Returns:
        oid of new object
        Throws:
        SQLException - on error
      • delete

        public void delete​(long oid)
                    throws SQLException
        This deletes a large object.
        Parameters:
        oid - describing object to delete
        Throws:
        SQLException - on error
      • unlink

        @Deprecated
        public void unlink​(int oid)
                    throws SQLException
        Deprecated.
        As of 8.3, replaced by unlink(long)

        This deletes a large object.

        It is identical to the delete method, and is supplied as the C API uses unlink.

        Parameters:
        oid - describing object to delete
        Throws:
        SQLException - on error
      • unlink

        public void unlink​(long oid)
                    throws SQLException

        This deletes a large object.

        It is identical to the delete method, and is supplied as the C API uses unlink.

        Parameters:
        oid - describing object to delete
        Throws:
        SQLException - on error