|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.sourceforge.jxutil.sql.type.AbstractBLOB | +--org.sourceforge.jxdbcon.postgresql.PGBlob
The PGBlob class implements Blobs. Blobs are only available in Transactions. You need to set the connection's autoCommit feature to false. In PostgreSQL there is no real Blob type, the oid type is used for this purpose. This implementation supports both reading and writing existing blobs.
Field Summary | |
private Connection |
conn
Our connection. |
private int |
handle
The Large Object handle. |
private static int |
INV_READ
|
private static int |
INV_WRITE
|
private long |
objOid
The object oid. |
private CallableStatement |
read
Readily prepared call to the read function. |
private CallableStatement |
seek
Readily prepared call to the seek function. |
private static int |
SEEK_CUR
|
private static int |
SEEK_END
|
private static int |
SEEK_SET
|
private CallableStatement |
write
Readily prepared call to the write function. |
Constructor Summary | |
PGBlob(Connection conn)
Initialise the blob with the connection, create a new oid. |
|
PGBlob(Connection conn,
long objOid)
Initialise the blob with the connection and the oid. |
Method Summary | |
void |
close()
Close the LOB handle. |
byte[] |
getBytes(long pos,
int length)
Get a chunk of data. |
long |
getObjOid()
|
long |
length()
Determine Large Object's length. |
long |
position(Blob pattern,
long start)
Not implemented. |
long |
position(byte[] pattern,
long start)
Not implemented. |
(package private) void |
prepareCalls()
Prepare the calls to the lo_lseek, loread and lowrite functions. |
int |
setBytes(long pos,
byte[] data)
Write a chunk of data. |
int |
setBytes(long pos,
byte[] data,
int spos,
int len)
Write a chunk of data. |
String |
toString()
for debugging purposes. |
void |
truncate(long x)
Not implemented. |
Methods inherited from class org.sourceforge.jxutil.sql.type.AbstractBLOB |
getBinaryStream, setBinaryStream |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private Connection conn
private int handle
private static final int INV_READ
private static final int INV_WRITE
private long objOid
private CallableStatement read
private CallableStatement seek
private static final int SEEK_CUR
private static final int SEEK_END
private static final int SEEK_SET
private CallableStatement write
Constructor Detail |
public PGBlob(Connection conn) throws SQLException
public PGBlob(Connection conn, long objOid) throws SQLException
Method Detail |
public void close() throws SQLException
SQLException
public byte[] getBytes(long pos, int length) throws SQLException
SQLException
public long getObjOid()
public long length() throws SQLException
SQLException
public long position(Blob pattern, long start) throws SQLException
SQLException
public long position(byte[] pattern, long start) throws SQLException
SQLException
void prepareCalls() throws SQLException
SQLException
public int setBytes(long pos, byte[] data) throws SQLException
setBytes
in interface Blob
setBytes
in class AbstractBLOB
SQLException
public int setBytes(long pos, byte[] data, int spos, int len) throws SQLException
SQLException
public String toString()
toString
in class Object
public void truncate(long x) throws SQLException
SQLException
|
jxDBCon 0.9z | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |