クラス LargeObjectManager
It provides methods that allow client code to create, open and delete large objects from the database. When opening an object, an instance of org.postgresql.largeobject.LargeObject is returned, and its methods then allow access to the object.
This class can only be created by BaseConnection
To get access to this class, use the following segment of code:
import org.postgresql.largeobject.*; Connection conn; LargeObjectManager lobj; ... code that opens a connection ... lobj = ((org.postgresql.PGConnection)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 org.postgresql.largeobject.LargeObject on how to manipulate the contents of a Large Object.
-
フィールドの概要
フィールド -
コンストラクタの概要
コンストラクタ -
メソッドの概要
修飾子とタイプメソッド説明int
create()
推奨されていません。int
create
(int mode) 推奨されていません。As of 8.3, replaced bycreateLO(int)
long
createLO()
This creates a large object, returning its OID.long
createLO
(int mode) This creates a large object, returning its OID.void
delete
(int oid) 推奨されていません。As of 8.3, replaced bydelete(long)
void
delete
(long oid) This deletes a large object.open
(int oid) 推奨されていません。As of 8.3, replaced byopen(long)
open
(int oid, boolean commitOnClose) This opens an existing large object, same as previous method, but commits the transaction on close if asked.open
(int oid, int mode) 推奨されていません。As of 8.3, replaced byopen(long, int)
open
(int oid, int mode, boolean commitOnClose) This opens an existing large object, same as previous method, but commits the transaction on close if asked.open
(long oid) This opens an existing large object, based on its OID.open
(long oid, boolean commitOnClose) This opens an existing large object, same as previous method, but commits the transaction on close if asked.open
(long oid, int mode) This opens an existing large object, based on its OID.open
(long oid, int mode, boolean commitOnClose) This opens an existing large object, based on its OID.void
unlink
(int oid) 推奨されていません。As of 8.3, replaced byunlink(long)
void
unlink
(long oid) This deletes a large object.
-
フィールド詳細
-
WRITE
public static final int WRITEThis mode indicates we want to write to an object.- 関連項目:
-
READ
public static final int READThis mode indicates we want to read an object.- 関連項目:
-
READWRITE
public static final int READWRITEThis mode is the default. It indicates we want read and write access to a large object.- 関連項目:
-
-
コンストラクタの詳細
-
LargeObjectManager
Constructs the LargeObject API.
Important Notice
This method should only be called byBaseConnection
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.- パラメータ:
conn
- connection- 例外:
SQLException
- if something wrong happens
-
-
メソッドの詳細
-
open
推奨されていません。As of 8.3, replaced byopen(long)
This opens an existing large object, based on its OID. This method assumes that READ and WRITE access is required (the default).- パラメータ:
oid
- of large object- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
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.- パラメータ:
oid
- of large objectcommitOnClose
- commit the transaction when this LOB will be closed- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
This opens an existing large object, based on its OID. This method assumes that READ and WRITE access is required (the default).- パラメータ:
oid
- of large object- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
This opens an existing large object, same as previous method, but commits the transaction on close if asked.- パラメータ:
oid
- of large objectcommitOnClose
- commit the transaction when this LOB will be closed- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
推奨されていません。As of 8.3, replaced byopen(long, int)
This opens an existing large object, based on its OID.- パラメータ:
oid
- of large objectmode
- mode of open- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
This opens an existing large object, same as previous method, but commits the transaction on close if asked.- パラメータ:
oid
- of large objectmode
- mode of opencommitOnClose
- commit the transaction when this LOB will be closed- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
This opens an existing large object, based on its OID.- パラメータ:
oid
- of large objectmode
- mode of open- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
open
This opens an existing large object, based on its OID.- パラメータ:
oid
- of large objectmode
- mode of opencommitOnClose
- commit the transaction when this LOB will be closed- 戻り値:
- LargeObject instance providing access to the object
- 例外:
SQLException
- on error
-
create
推奨されていません。As of 8.3, replaced bycreateLO()
This creates a large object, returning its OID.
It defaults to READWRITE for the new object's attributes.
- 戻り値:
- oid of new object
- 例外:
SQLException
- on error
-
createLO
This creates a large object, returning its OID.
It defaults to READWRITE for the new object's attributes.
- 戻り値:
- oid of new object
- 例外:
SQLException
- if something wrong happens
-
createLO
This creates a large object, returning its OID.- パラメータ:
mode
- a bitmask describing different attributes of the new object- 戻り値:
- oid of new object
- 例外:
SQLException
- on error
-
create
推奨されていません。As of 8.3, replaced bycreateLO(int)
This creates a large object, returning its OID.- パラメータ:
mode
- a bitmask describing different attributes of the new object- 戻り値:
- oid of new object
- 例外:
SQLException
- on error
-
delete
This deletes a large object.- パラメータ:
oid
- describing object to delete- 例外:
SQLException
- on error
-
unlink
推奨されていません。As of 8.3, replaced byunlink(long)
This deletes a large object.
It is identical to the delete method, and is supplied as the C API uses unlink.
- パラメータ:
oid
- describing object to delete- 例外:
SQLException
- on error
-
unlink
This deletes a large object.
It is identical to the delete method, and is supplied as the C API uses unlink.
- パラメータ:
oid
- describing object to delete- 例外:
SQLException
- on error
-
delete
推奨されていません。As of 8.3, replaced bydelete(long)
This deletes a large object.- パラメータ:
oid
- describing object to delete- 例外:
SQLException
- on error
-
createLO()