Public Member Functions | |
Blob (byte[] data) | |
long | length () throws SQLException |
byte[] | getBytes (long pos, int length) throws SQLException |
java.io.InputStream | getBinaryStream () throws SQLException |
long | position (byte pattern[], long start) throws SQLException |
long | position (java.sql.Blob pattern, long start) throws SQLException |
int | setBytes (long pos, byte[] bytes) throws SQLException |
int | setBytes (long pos, byte[] bytes, int offset, int len) throws SQLException |
java.io.OutputStream | setBinaryStream (long pos) throws SQLException |
void | truncate (long len) throws SQLException |
Package Attributes | |
byte[] | binaryData = null |
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. By default drivers implement 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 DriverResultSet,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. In addition, this interface has methods for updating a BLOB
value.
Definition at line 57 of file Blob.java.
|
Creates a new
Definition at line 67 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.binaryData. 00068 { 00069 binaryData = data; 00070 }
|
|
Retrieves the
Definition at line 123 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.binaryData. 00124 { 00125 return new ByteArrayInputStream(binaryData); 00126 }
|
|
Retrieves all or part of the
Definition at line 104 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.binaryData, and org.objectweb.cjdbc.driver.Blob.length(). 00105 { 00106 byte[] newData = new byte[length]; 00107 00108 System.arraycopy(binaryData, (int) (pos - 1), newData, 0, length); 00109 00110 return newData; 00111 }
|
|
Returns the number of bytes in the
Definition at line 81 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.binaryData. Referenced by org.objectweb.cjdbc.driver.Blob.getBytes(). 00082 { 00083 return binaryData.length; 00084 }
|
|
Retrieves the byte position in the
Definition at line 161 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.position(). 00162 { 00163 return position(pattern.getBytes(0, (int) pattern.length()), start); 00164 }
|
|
Retrieves the byte position at which the specified byte array
Definition at line 142 of file Blob.java. References org.objectweb.cjdbc.driver.Blob.binaryData. Referenced by org.objectweb.cjdbc.driver.Blob.position(). 00143 { 00144 return (new String(binaryData)).indexOf(new String(pattern), (int) start); 00145 }
|
|
Retrieves a stream that can be used to write to the
Definition at line 229 of file Blob.java. 00230 { 00231 throw new NotImplementedException("setBinaryStream"); 00232 }
|
|
Writes all or part of the given
Definition at line 209 of file Blob.java. 00211 { 00212 throw new NotImplementedException("setBytes"); 00213 }
|
|
Writes the given array of bytes to the
Definition at line 183 of file Blob.java. 00184 { 00185 throw new NotImplementedException("setBytes"); 00186 }
|
|
Truncates the
Definition at line 245 of file Blob.java. 00246 { 00247 throw new NotImplementedException("truncate"); 00248 }
|
|
The binary data that makes up this Definition at line 60 of file Blob.java. Referenced by org.objectweb.cjdbc.driver.Blob.Blob(), org.objectweb.cjdbc.driver.Blob.getBinaryStream(), org.objectweb.cjdbc.driver.Blob.getBytes(), org.objectweb.cjdbc.driver.Blob.length(), and org.objectweb.cjdbc.driver.Blob.position(). |