|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.datatype.BlobImpl
public class 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(InputStream stream)
Constructor taking an InputStream. |
|
BlobImpl(Object obj)
Constructor taking a serialised object. |
|
| Method Summary | |
|---|---|
void |
free()
Free the Blob object and releases the resources that it holds. |
InputStream |
getBinaryStream()
|
InputStream |
getBinaryStream(long pos,
long length)
Returns an InputStream object that contains a partial Blob value, starting with the byte specified by pos, which is length bytes in length. |
byte[] |
getBytes(long pos,
int length)
|
Object |
getObject()
Accessor for the Object. |
long |
length()
|
long |
position(Blob pattern,
long start)
|
long |
position(byte[] pattern,
long start)
|
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(Object obj)
throws IOException
obj - The serialised object.
IOExceptionpublic BlobImpl(byte[] bytes)
bytes - The byte arraypublic BlobImpl(InputStream stream)
stream - The InputStream| Method Detail |
|---|
public Object getObject()
throws SQLException
SQLException
public long length()
throws SQLException
length in interface BlobSQLException
public byte[] getBytes(long pos,
int length)
throws SQLException
getBytes in interface BlobSQLException
public int setBytes(long value,
byte[] bytes,
int pos,
int length)
throws SQLException
setBytes in interface BlobSQLException
public void truncate(long value)
throws SQLException
truncate in interface BlobSQLException
public int setBytes(long value,
byte[] bytes)
throws SQLException
setBytes in interface BlobSQLException
public InputStream getBinaryStream()
throws SQLException
getBinaryStream in interface BlobSQLException
public InputStream getBinaryStream(long pos,
long length)
throws SQLException
getBinaryStream in interface Blobpos - the offset to the first byte of the partial value to be retrieved.
The first byte in the Blob is at position 1length - the length in bytes of the partial value to be retrieved
SQLException
public OutputStream setBinaryStream(long value)
throws SQLException
setBinaryStream in interface BlobSQLException
public void free()
throws SQLException
free in interface BlobSQLException
public long position(byte[] pattern,
long start)
throws SQLException
position in interface BlobSQLException
public long position(Blob pattern,
long start)
throws SQLException
position in interface BlobSQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||