| java.lang.Object com.mysql.jdbc.BlobFromLocator
BlobFromLocator | public class BlobFromLocator implements java.sql.Blob(Code) | | The representation (mapping) in the JavaTM 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.
author: Mark Matthews version: $Id: BlobFromLocator.java,v 1.1.4.1 2005/05/19 18:31:49 mmatthews version: Exp $ |
Inner Class :class LocatorInputStream extends InputStream | |
Method Summary | |
java.sql.PreparedStatement | createGetBytesStatement() | public void | free() | public java.io.InputStream | getBinaryStream() Retrieves the BLOB designated by this Blob instance as a stream. | public InputStream | getBinaryStream(long pos, long length) | public byte[] | getBytes(long pos, int length) Returns as an array of bytes, part or all of the BLOB value that this
Blob object designates.
Parameters: pos - where to start the part of the BLOB Parameters: length - the length of the part of the BLOB you want returned. | byte[] | getBytesInternal(java.sql.PreparedStatement pStmt, long pos, int length) | public long | length() Returns the number of bytes in the BLOB value designated by this Blob
object. | public long | position(java.sql.Blob pattern, long start) Finds the position of the given pattern in this BLOB. | public long | position(byte[] pattern, long start) | public OutputStream | setBinaryStream(long indexToWriteAt) | public int | setBytes(long writeAt, byte[] bytes, int offset, int length) | public int | setBytes(long writeAt, byte[] bytes) | public void | truncate(long length) |
BlobFromLocator | BlobFromLocator(ResultSetImpl creatorResultSetToSet, int blobColumnIndex) throws SQLException(Code) | | Creates an updatable BLOB that can update in-place
|
getBinaryStream | public java.io.InputStream getBinaryStream() throws SQLException(Code) | | Retrieves the BLOB designated by this Blob instance as a stream.
this BLOB represented as a binary stream of bytes. throws: SQLException - if a database error occurs |
getBytes | public byte[] getBytes(long pos, int length) throws SQLException(Code) | | Returns as an array of bytes, part or all of the BLOB value that this
Blob object designates.
Parameters: pos - where to start the part of the BLOB Parameters: length - the length of the part of the BLOB you want returned. the bytes stored in the blob starting at positionpos and having a length of length . throws: SQLException - if a database error occurs |
length | public long length() throws SQLException(Code) | | Returns the number of bytes in the BLOB value designated by this Blob
object.
the length of this blob throws: SQLException - if a database error occurs |
position | public long position(java.sql.Blob pattern, long start) throws SQLException(Code) | | Finds the position of the given pattern in this BLOB.
Parameters: pattern - the pattern to find Parameters: start - where to start finding the pattern the position where the pattern is found in the BLOB, -1 if notfound throws: SQLException - if a database error occurs |
|
|