Class PostgresLargeObjectManager


  • public class PostgresLargeObjectManager
    extends java.lang.Object
    Helper class for when the postresql driver is not directly availalbe.
    • 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close​(java.lang.Object largeObject)  
      java.lang.Long createLO​(java.sql.Connection connection)  
      java.lang.Object open​(java.sql.Connection connection, long oid, int mode)  
      byte[] read​(java.lang.Object largeObject, int length)  
      void seek​(java.lang.Object largeObject, int position)  
      int size​(java.lang.Object largeObject)  
      void truncate​(java.lang.Object largeObject, int position)  
      java.sql.Connection unwrap​(java.sql.Connection connection)  
      void write​(java.lang.Object largeObject, byte[] data)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • PostgresLargeObjectManager

        public PostgresLargeObjectManager()
    • Method Detail

      • createLO

        public final java.lang.Long createLO​(java.sql.Connection connection)
                                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • open

        public java.lang.Object open​(java.sql.Connection connection,
                                     long oid,
                                     int mode)
                              throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • size

        public int size​(java.lang.Object largeObject)
                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • close

        public void close​(java.lang.Object largeObject)
                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • read

        public byte[] read​(java.lang.Object largeObject,
                           int length)
                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • write

        public void write​(java.lang.Object largeObject,
                          byte[] data)
                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • seek

        public void seek​(java.lang.Object largeObject,
                         int position)
                  throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • truncate

        public void truncate​(java.lang.Object largeObject,
                             int position)
                      throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • unwrap

        public final java.sql.Connection unwrap​(java.sql.Connection connection)
                                         throws java.sql.SQLException
        Throws:
        java.sql.SQLException