public class IfxBblob
extends java.lang.Object
implements java.sql.Blob
By default, a Blob is a transaction duration reference to a binary large object. By default, a Blob is implemented using a LOCATOR(blob) internally.
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
blobBuffer |
protected java.lang.String |
BlobFileName |
protected long |
blobSize |
protected java.io.InputStream |
blobStream |
protected com.informix.jdbc.IfxConnection |
conn |
protected short |
ifxType |
protected boolean |
isBlob_loaded |
protected IfxLocator |
locatorPointer |
protected static short |
MODE_CLIENT_ONLY |
protected static short |
MODE_READ_WRITE |
protected static short |
MODE_RW_BUFF |
protected int |
smartBlobMode |
protected IfxSmartBlob |
smb |
protected com.informix.jdbc.IfxTmpFile |
tempBlobFile |
protected static short |
TYPE_IS_BLOB |
protected static short |
TYPE_IS_CLOB |
| Modifier | Constructor and Description |
|---|---|
|
IfxBblob()
Creates an IfxBblob instance.
|
protected |
IfxBblob(byte[] buffer)
Creates an IfxBblob instance with the given byte[].
|
|
IfxBblob(java.sql.Connection conn,
byte[] buffer)
Creates an IfxBblob instance with a given connection and a buffer
containing data.
|
|
IfxBblob(java.sql.Connection conn,
byte[] buffer,
IfxLobDescriptor loDesc)
Creates an IfxBblob instance with a given connection and a buffer
containing data and a specified lob descriptor.
|
|
IfxBblob(java.sql.Connection conn,
byte[] buffer,
java.lang.String sbspaceName)
Creates an IfxBblob instance with a given connection and a buffer
containing data and a specified smart blob space.
|
|
IfxBblob(java.sql.Connection connection,
IfxLocator locator)
Creates an IfxBblob instance with a given connection and a locator.
|
|
IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length)
Creates an IfxBblob instance with a given connection, an inputStream
and number of bytes to write.
|
|
IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
IfxLobDescriptor loDesc)
Creates an IfxBblob instance with a given connection, an inputStream,
number of bytes to write and a specified lob descriptor.
|
|
IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
java.lang.String sbspaceName)
Creates an IfxBblob instance with a given connection, an inputStream
and number of bytes to write to a specified smart blob space.
|
|
IfxBblob(com.informix.jdbc.IfxConnection connection) |
|
IfxBblob(IfxLocator locator)
Creates an IfxBblob instance with the given locator.
|
protected |
IfxBblob(com.informix.jdbc.IfxTmpFile tempFile) |
|
IfxBblob(java.io.InputStream fin)
Creates an IfxBblob instance with the given input stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkIfFreed() |
void |
close()
This method will release the resources used by the object
|
com.informix.jdbc.IfxLob |
disableFinalize(boolean arg0) |
void |
free() |
protected byte[] |
getAll() |
java.io.InputStream |
getBinaryStream()
Retrieves the entire smart large object as a stream.
|
java.io.InputStream |
getBinaryStream(long arg0,
long arg1) |
protected byte[] |
getBytes() |
byte[] |
getBytes(long position,
int length)
Returns a copy of the contents of the smart large object at the
requested position.
|
protected short |
getIfxLobType() |
IfxLocator |
getLocator() |
IfxLoStat |
getLoStat()
This method returns an IfxLoStat object, which provides statistical
information, such as the last access time, the last update status time,
the last modification time, and the reference count of the smart large
object.
|
protected byte[] |
getPortion(long arg0,
long arg1) |
protected byte[] |
getPortion(long arg0,
long arg1,
long arg2) |
protected java.io.InputStream |
getStream() |
protected java.io.InputStream |
getStream(long arg0,
long arg1) |
protected java.io.InputStream |
getStreamImd() |
long |
length()
Gets the length of the binary smart large object in bytes.
|
protected void |
loadSmBlob() |
long |
position(java.sql.Blob pattern,
long start)
Determines the byte position at which the given pattern occurs.
|
long |
position(byte[] pattern,
long start)
Determines the byte position at which the given byte pattern occurs.
|
long |
seek(long offset,
int whence)
This method sets the position for the next read and write operation of
the smart large object.
|
java.io.OutputStream |
setBinaryStream(long pos)
Retrieves a stream that can be used to write to the BLOB value that this Blob object represents.
|
void |
setBinaryStream(long position,
java.io.InputStream fin,
int length)
Writes binary stream of data from an InputStream to an already existing
smart large blob object.
|
protected int |
setBuffer(byte[] arg0) |
protected int |
setBuffer(byte[] arg0,
int arg1,
int arg2) |
int |
setBytes(long position,
byte[] buffer)
Writes binary data from a buffer to an existing smart
large blob object.
|
int |
setBytes(long position,
byte[] bytes,
int offset,
int len)
Writes all or part of the given byte array to the BLOB value that this
Blob object represents and returns the number of bytes written.
|
protected void |
setConnection(com.informix.jdbc.IfxConnection arg0) |
protected void |
setIfxLobType(short arg0) |
protected void |
setLoadFlag() |
protected void |
setLocator(IfxLocator arg0) |
protected void |
setMode(int arg0) |
protected void |
setSize(long arg0) |
protected void |
setStream(java.io.InputStream arg0,
int arg1) |
void |
truncate(long size)
This method truncates the smart large object at the given position.
|
void |
upgradeToWriteLock() |
protected void |
verifySmbMode() |
protected void |
verifySmbMode(boolean arg0) |
long |
where()
This method returns the current seek position within the large object.
|
protected static final short TYPE_IS_BLOB
protected static final short TYPE_IS_CLOB
protected static final short MODE_READ_WRITE
protected static final short MODE_RW_BUFF
protected static final short MODE_CLIENT_ONLY
protected IfxSmartBlob smb
protected IfxLocator locatorPointer
protected com.informix.jdbc.IfxConnection conn
protected boolean isBlob_loaded
protected com.informix.jdbc.IfxTmpFile tempBlobFile
protected java.io.InputStream blobStream
protected byte[] blobBuffer
protected java.lang.String BlobFileName
protected long blobSize
protected short ifxType
protected int smartBlobMode
public IfxBblob()
public IfxBblob(IfxLocator locator)
locator - the locator that references the smart large objectpublic IfxBblob(java.sql.Connection connection,
IfxLocator locator)
throws java.sql.SQLException
connection - the IfxConnection objectlocator - the locator that references the smart large objectjava.sql.SQLException - if the LOB cannot be openedpublic IfxBblob(com.informix.jdbc.IfxConnection connection)
throws java.sql.SQLException
java.sql.SQLExceptionprotected IfxBblob(byte[] buffer)
buffer - The data buffer.public IfxBblob(java.io.InputStream fin)
fin - the input stream to use for this smart large objectprotected IfxBblob(com.informix.jdbc.IfxTmpFile tempFile)
public IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length)
throws java.sql.SQLException
conn - the Connection objectfin - the input stream from which the data will be written into
the smart large objectlength - number of bytes to be writtenjava.sql.SQLException - if object instance cannot be instantiatedpublic IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
java.lang.String sbspaceName)
throws java.sql.SQLException
conn - the Connection object.fin - the input stream from which the data will be written into
the smart large objectlength - number of bytes to be writtensbspaceName - specified smart blob space namejava.sql.SQLException - if object instance cannot be instantiatedpublic IfxBblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
IfxLobDescriptor loDesc)
throws java.sql.SQLException
conn - the Connection objectfin - the input stream from which the data will be written into
the smart large objectlength - number of bytes to be writtenloDesc - user created lob descriptorjava.sql.SQLException - if object instance cannot be instantiatedpublic IfxBblob(java.sql.Connection conn,
byte[] buffer)
throws java.sql.SQLException
conn - the Connection objectbuffer - from which the data will be written to smart blobjava.sql.SQLException - if object instance cannot be instantiatedpublic IfxBblob(java.sql.Connection conn,
byte[] buffer,
java.lang.String sbspaceName)
throws java.sql.SQLException
conn - the Connection objectbuffer - from which the data will be written to smart blobsbspaceName - specified smart blob space namejava.sql.SQLException - if object instance cannot be instantiatedpublic IfxBblob(java.sql.Connection conn,
byte[] buffer,
IfxLobDescriptor loDesc)
throws java.sql.SQLException
conn - the Connection objectbuffer - from which the data will be written to smart blobloDesc - user defined lob descriptorjava.sql.SQLException - if object instance cannot be instantiatedpublic long length()
throws java.sql.SQLException
length in interface java.sql.Blobjava.sql.SQLException - if there is an error accessing the length of
the BLOBpublic byte[] getBytes(long position,
int length)
throws java.sql.SQLException
getBytes in interface java.sql.Blobposition - the offset from the start of the smart large objectlength - the number of consecutive bytes to be copiedjava.sql.SQLException - if there is an error accessing the BLOBpublic java.io.InputStream getBinaryStream()
throws java.sql.SQLException
getBinaryStream in interface java.sql.Blobjava.sql.SQLException - if there is an error accessing the BLOBpublic long position(byte[] pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - the pattern to search forstart - the position at which to begin searchingjava.sql.SQLException - if there is an error accessing the BLOBpublic long position(java.sql.Blob pattern,
long start)
throws java.sql.SQLException
position in interface java.sql.Blobpattern - the pattern to search forstart - the position at which to begin searchingjava.sql.SQLException - if there is an error accessing the BLOBpublic void setBinaryStream(long position,
java.io.InputStream fin,
int length)
throws java.sql.SQLException
position - at which smart large object will be writtenfin - InputStreamlength - number of bytes to be written from the input streamjava.sql.SQLException - if there is an error accessing the BLOBpublic int setBytes(long position,
byte[] buffer)
throws java.sql.SQLException
setBytes in interface java.sql.Blobposition - at which smart large object will be writtenbuffer - contain the datajava.sql.SQLException - if there is an error accessing the BLOBpublic void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseablejava.sql.SQLException - if there is an error accessing the BLOBpublic long seek(long offset,
int whence)
throws java.sql.SQLException
offset - From the location specified in the whence parameterwhence - Define the offset value more specifically;
LO_SEEK_SET, from begining; LO_SEEK_CUR, relative from current
position; LO_SEEK_END, from the end.java.sql.SQLException - if there is an error accessing the BLOBpublic long where()
throws java.sql.SQLException
java.sql.SQLException - if there is an error accessing the BLOBpublic IfxLoStat getLoStat() throws java.sql.SQLException
java.sql.SQLException - if there is an error accessing the BLOBpublic void truncate(long size)
throws java.sql.SQLException
truncate in interface java.sql.Blobsize - at which the truncation will occurjava.sql.SQLException - if there is an error accessing the BLOBpublic int setBytes(long position,
byte[] bytes,
int offset,
int len)
throws java.sql.SQLException
setBytes in interface java.sql.Blobposition - the position in the BLOB object at which to start writingbytes - the array of bytes to be written to this BLOB objectoffset - the offset into the array bytes at which to start reading the bytes to be setlen - the number of bytes to be written to the BLOB value from the array of bytes bytesjava.sql.SQLException - if there is an error accessing the BLOB valuepublic java.io.OutputStream setBinaryStream(long pos)
throws java.sql.SQLException
setBinaryStream in interface java.sql.Blobpos - the position in the BLOB value at which to start writingjava.sql.SQLException - if there is an error accessing the BLOB valuepublic void free()
throws java.sql.SQLException
free in interface java.sql.Blobjava.sql.SQLExceptionpublic IfxLocator getLocator() throws java.sql.SQLException
java.sql.SQLExceptionprotected void setLocator(IfxLocator arg0) throws java.sql.SQLException
java.sql.SQLExceptionprotected void setIfxLobType(short arg0)
protected void setSize(long arg0)
protected void setConnection(com.informix.jdbc.IfxConnection arg0)
protected void setLoadFlag()
protected short getIfxLobType()
protected void setMode(int arg0)
protected byte[] getBytes()
throws java.sql.SQLException
java.sql.SQLExceptionprotected byte[] getPortion(long arg0,
long arg1)
throws java.sql.SQLException
java.sql.SQLExceptionprotected byte[] getAll()
throws java.sql.SQLException
java.sql.SQLExceptionprotected byte[] getPortion(long arg0,
long arg1,
long arg2)
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.io.InputStream getStreamImd()
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.io.InputStream getStream()
throws java.sql.SQLException
java.sql.SQLExceptionprotected java.io.InputStream getStream(long arg0,
long arg1)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(long arg0,
long arg1)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void setStream(java.io.InputStream arg0,
int arg1)
throws java.sql.SQLException
java.sql.SQLExceptionprotected int setBuffer(byte[] arg0)
throws java.sql.SQLException
java.sql.SQLExceptionprotected int setBuffer(byte[] arg0,
int arg1,
int arg2)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void loadSmBlob()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void verifySmbMode()
throws java.sql.SQLException
java.sql.SQLExceptionprotected void verifySmbMode(boolean arg0)
throws java.sql.SQLException
java.sql.SQLExceptionprotected void checkIfFreed()
throws java.sql.SQLException
java.sql.SQLExceptionpublic void upgradeToWriteLock()
throws java.sql.SQLException
java.sql.SQLExceptionpublic com.informix.jdbc.IfxLob disableFinalize(boolean arg0)