org.firebirdsql.jdbc

Interface FirebirdBlob

All Superinterfaces:
Blob
Known Implementing Classes:
FBBlob, FBCachedBlob

public interface FirebirdBlob
extends Blob

Firebird Blob abstraction. This interface defines methods to read and write Blob content.
Author:
Roman Rokytskyy

Nested Class Summary

static interface
FirebirdBlob.BlobInputStream
Blob input stream.
static interface
FirebirdBlob.BlobOutputStream
Blob output stream.

Method Summary

FirebirdBlob
detach()
Detach this blob.
boolean
isSegmented()
Check if blob is segmented.
OutputStream
setBinaryStream(long position)
Retrieves a stream that can be used to write to the Blob value that this object represents.

Method Details

detach

public FirebirdBlob detach()
            throws SQLException
Detach this blob. This method creates new instance of the same blob database object that is not under result set control. When result set is closed, all associated resources are also released, including open blob streams. This method creates an new instance of blob object with the same blob ID that can be used even when result set is closed.

Note, detached blob will not remember the stream position of this object. This means that you cannot start reading data from the blob, then detach it, and then continue reading. Reading from detached blob will begin at the blob start.

Returns:
instance of FirebirdBlob that is not under result set control.

isSegmented

public boolean isSegmented()
            throws SQLException
Returns:
true if this blob is segmented, otherwise false

setBinaryStream

public OutputStream setBinaryStream(long position)
            throws SQLException
Retrieves a stream that can be used to write to the Blob value that this object represents. The stream begins at position position.

This method is directly copied from JDBC 3.0 classes to make it available in JDBC 2.0 environment.

Parameters:
position - the position in the BLOB value at which to start writing; currently only position 0 is supported.
Returns:
a java.io.OutputStream object to which data can be written

Copyright B) 2001 David Jencks and other authors. All rights reserved.