All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class postgresql.largeobject.LargeObjectManager

java.lang.Object
   |
   +----postgresql.largeobject.LargeObjectManager

public class LargeObjectManager
extends Object
This class implements the large object interface to postgresql.

It provides methods that allow client code to create, open and delete large objects from the database. When opening an object, an instance of postgresql.largeobject.LargeObject is returned, and its methods then allow access to the object.

This class can only be created by postgresql.Connection

To get access to this class, use the following segment of code:

 import postgresql.largeobject.*;
 Connection  conn;
 LargeObjectManager lobj;
 ... code that opens a connection ...
 lobj = ((postgresql.Connection)myconn).getLargeObjectAPI();
 

Normally, client code would use the getAsciiStream, getBinaryStream, or getUnicodeStream methods in ResultSet, or setAsciiStream, setBinaryStream, or setUnicodeStream methods in PreparedStatement to access Large Objects.

However, sometimes lower level access to Large Objects are required, that are not supported by the JDBC specification.

Refer to postgresql.largeobject.LargeObject on how to manipulate the contents of a Large Object.

See Also:
LargeObject, getAsciiStream, getBinaryStream, getUnicodeStream, setAsciiStream, setBinaryStream, setUnicodeStream, getAsciiStream, getBinaryStream, getUnicodeStream, setAsciiStream, setBinaryStream, setUnicodeStream

Variable Index

 o READ
This mode indicates we want to read an object
 o READWRITE
This mode is the default.
 o WRITE
This mode indicates we want to write to an object

Constructor Index

 o LargeObjectManager(Connection)
Constructs the LargeObject API.

Method Index

 o create()
This creates a large object, returning its OID.
 o create(int)
This creates a large object, returning its OID
 o delete(int)
This deletes a large object.
 o open(int)
This opens an existing large object, based on its OID.
 o open(int, int)
This opens an existing large object, based on its OID
 o unlink(int)
This deletes a large object.

Variables

 o WRITE
 public static final int WRITE
This mode indicates we want to write to an object

 o READ
 public static final int READ
This mode indicates we want to read an object

 o READWRITE
 public static final int READWRITE
This mode is the default. It indicates we want read and write access to a large object

Constructors

 o LargeObjectManager
 public LargeObjectManager(Connection conn) throws SQLException
Constructs the LargeObject API.

Important Notice
This method should only be called by postgresql.Connection

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

Methods

 o open
 public LargeObject open(int 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
 o open
 public LargeObject open(int 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
 o create
 public int create() 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
on error
 o create
 public int create(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
 o delete
 public void delete(int oid) throws SQLException
This deletes a large object.

Parameters:
oid - describing object to delete
Throws: SQLException
on error
 o unlink
 public void unlink(int 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

All Packages  Class Hierarchy  This Package  Previous  Next  Index