public class JnaBlob extends AbstractFbBlob implements FbBlob, DatabaseListener
FbBlob for native client access.FbBlob.SeekModeexceptionListenerDispatcherNO_BLOB_ID| Constructor and Description |
|---|
JnaBlob(JnaDatabase database,
JnaTransaction transaction,
BlobParameterBuffer blobParameterBuffer) |
JnaBlob(JnaDatabase database,
JnaTransaction transaction,
BlobParameterBuffer blobParameterBuffer,
long blobId) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cancelImpl()
Internal implementation of
AbstractFbBlob.cancel(). |
protected void |
closeImpl()
Internal implementation of
AbstractFbBlob.close(). |
long |
getBlobId() |
byte[] |
getBlobInfo(byte[] requestItems,
int bufferLength)
Request blob info.
|
JnaDatabase |
getDatabase() |
int |
getHandle() |
com.sun.jna.ptr.IntByReference |
getJnaHandle() |
byte[] |
getSegment(int sizeRequested)
Gets a segment of blob data.
|
JnaTransaction |
getTransaction() |
boolean |
isOutput() |
void |
open()
Opens an existing input blob, or creates an output blob.
|
void |
putSegment(byte[] segment)
Writes a segment of blob data.
|
protected void |
releaseResources()
Release Java resources held.
|
void |
seek(int offset,
FbBlob.SeekMode seekMode)
Performs a seek on a blob with the specified
seekMode and offset. |
addExceptionListener, cancel, checkBlobClosed, checkBlobOpen, checkDatabaseAttached, checkTransactionActive, clearDatabase, clearTransaction, close, createBlobLengthProcessor, detached, detaching, getBlobInfo, getBlobParameterBuffer, getMaximumSegmentSize, isEndingTransaction, isEof, isOpen, length, removeExceptionListener, resetEof, setEof, setOpen, transactionStateChanged, warningReceived, withLockclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcancel, close, getBlobInfo, getMaximumSegmentSize, isEof, isOpen, lengthaddExceptionListener, removeExceptionListenerdetached, detaching, warningReceivedpublic JnaBlob(JnaDatabase database, JnaTransaction transaction, BlobParameterBuffer blobParameterBuffer)
public JnaBlob(JnaDatabase database, JnaTransaction transaction, BlobParameterBuffer blobParameterBuffer, long blobId)
public JnaDatabase getDatabase()
getDatabase in interface FbBlobgetDatabase in class AbstractFbBlobpublic JnaTransaction getTransaction()
getTransaction in class AbstractFbBlobpublic int getHandle()
public final com.sun.jna.ptr.IntByReference getJnaHandle()
public final long getBlobId()
public void open()
throws java.sql.SQLException
FbBlobpublic final boolean isOutput()
public byte[] getSegment(int sizeRequested)
throws java.sql.SQLException
FbBlob
When sizeRequested exceeds FbBlob.getMaximumSegmentSize() it is silently reduced to the maximum
segment size.
getSegment in interface FbBlobsizeRequested - Requested segment size (> 0).java.sql.SQLException - If this is an output blob, the blob is closed, the transaction is not active, or a database connection
error occurred.public void putSegment(byte[] segment)
throws java.sql.SQLException
FbBlob
Implementation must handle segment length exceeding FbBlob.getMaximumSegmentSize() by batching. TODO: reconsider and let caller handle that?
Passing a section that is length 0 will throw an SQLException.
putSegment in interface FbBlobsegment - Segment to writejava.sql.SQLException - If this is an input blob, the blob is closed, the transaction is not active, the segment is length 0 or
longer than the maximum segment size, or a database connection error occurred.public void seek(int offset,
FbBlob.SeekMode seekMode)
throws java.sql.SQLException
FbBlobseekMode and offset.
Firebird only supports seek on stream blobs.
seek in interface FbBloboffset - Offset of the seek, effect depends on value of seekModeseekMode - Value of FbBlob.SeekModejava.sql.SQLException - If the blob is closed, the transaction is not active, or a database error occurred.public byte[] getBlobInfo(byte[] requestItems,
int bufferLength)
throws java.sql.SQLException
FbBlobgetBlobInfo in interface FbBlobrequestItems - Array of info items to requestbufferLength - Response buffer length to usejava.sql.SQLExceptionprotected void closeImpl()
throws java.sql.SQLException
AbstractFbBlobAbstractFbBlob.close(). The implementation does not need
to check for attached database and active transaction, nor does it need to mark this blob as closed.closeImpl in class AbstractFbBlobjava.sql.SQLExceptionprotected void cancelImpl()
throws java.sql.SQLException
AbstractFbBlobAbstractFbBlob.cancel(). The implementation does not need
to check for attached database and active transaction, nor does it need to mark this blob as closed.cancelImpl in class AbstractFbBlobjava.sql.SQLExceptionprotected void releaseResources()
AbstractFbBlobreleaseResources in class AbstractFbBlobCopyright © 2001-2023 Jaybird (Firebird JDBC) team. All rights reserved.