|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jpox.store.rdbms.datatype.BlobImpl
The representation (mapping) in the Java TM
programming language of an SQL BLOB
value. An SQL
BLOB
is a built-in type that stores a Binary Large Object as a
column value in a row of a database table. The driver implements
Blob
using an SQL locator(BLOB)
, which means
that a Blob
object contains a logical pointer to the SQL
BLOB
data rather than the data itself. A Blob
object is valid for the duration of the transaction in which is was created.
Methods in the interfaces ResultSet
,
CallableStatement
, and PreparedStatement
,
such as getBlob
and setBlob
allow a programmer
to access an SQL BLOB
value. The Blob
interface
provides methods for getting the length of an SQL BLOB
(Binary
Large Object) value, for materializing a BLOB
value on the
client, and for determining the position of a pattern of bytes within a
BLOB
value.
This class is new in the JDBC 2.0 API.
Constructor Summary | |
BlobImpl(byte[] bytes)
Constructor taking a byte array. |
|
BlobImpl(java.io.InputStream stream)
Constructor taking an InputStream. |
|
BlobImpl(java.lang.Object obj)
Constructor taking a serialised object. |
Method Summary | |
java.io.InputStream |
getBinaryStream()
|
byte[] |
getBytes(long pos,
int length)
|
java.lang.Object |
getObject()
Accessor for the Object. |
long |
length()
|
long |
position(java.sql.Blob pattern,
long start)
|
long |
position(byte[] pattern,
long start)
|
java.io.OutputStream |
setBinaryStream(long value)
|
int |
setBytes(long value,
byte[] bytes)
|
int |
setBytes(long value,
byte[] bytes,
int pos,
int length)
|
void |
truncate(long value)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BlobImpl(java.lang.Object obj) throws java.io.IOException
obj
- The serialised object.
java.io.IOException
public BlobImpl(byte[] bytes)
bytes
- The byte arraypublic BlobImpl(java.io.InputStream stream)
stream
- The InputStreamMethod Detail |
public java.lang.Object getObject()
public long length() throws java.sql.SQLException
length
in interface java.sql.Blob
java.sql.SQLException
public byte[] getBytes(long pos, int length) throws java.sql.SQLException
getBytes
in interface java.sql.Blob
java.sql.SQLException
public int setBytes(long value, byte[] bytes, int pos, int length) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
java.sql.SQLException
public void truncate(long value)
truncate
in interface java.sql.Blob
public int setBytes(long value, byte[] bytes) throws java.sql.SQLException
setBytes
in interface java.sql.Blob
java.sql.SQLException
public java.io.InputStream getBinaryStream() throws java.sql.SQLException
getBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public java.io.OutputStream setBinaryStream(long value) throws java.sql.SQLException
setBinaryStream
in interface java.sql.Blob
java.sql.SQLException
public long position(byte[] pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
java.sql.SQLException
public long position(java.sql.Blob pattern, long start) throws java.sql.SQLException
position
in interface java.sql.Blob
java.sql.SQLException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |