public class IfxCblob
extends java.lang.Object
implements java.sql.NClob, java.sql.Clob
By default, a CLOB is a transaction duration reference to a character large object.
| Modifier and Type | Field and Description |
|---|---|
protected byte[] |
blobBuffer |
protected java.lang.String |
BlobFileName |
protected long |
blobSize |
protected java.io.InputStream |
blobStream |
protected 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 IfxTmpFile |
tempBlobFile |
protected static short |
TYPE_IS_BLOB |
protected static short |
TYPE_IS_CLOB |
| Modifier | Constructor and Description |
|---|---|
|
IfxCblob()
Creates an IfxCblob instance.
|
protected |
IfxCblob(byte[] buffer) |
|
IfxCblob(java.sql.Connection c,
byte[] buffer)
Creates an IfxCblob instance with the given connection and a buffer
containing data.
|
|
IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length)
Creates an IfxCblob instance with a given connection, an inputStream
and number of bytes to write.
|
|
IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
IfxLobDescriptor loDesc)
Creates an IfxCblob instance with a given connection, an inputStream,
number of bytes to write and a specified lob descriptor.
|
|
IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
java.lang.String sbspaceName)
Creates an IfxCblob instance with a given connection, an inputStream
and number of bytes to write to a specified smart blob space.
|
|
IfxCblob(java.sql.Connection conn,
java.lang.String str)
Creates an IfxCblob instance with a given connection and a string
of data.
|
|
IfxCblob(java.sql.Connection conn,
java.lang.String str,
IfxLobDescriptor loDesc)
Creates an IfxCblob instance with a given connection and a string
of data and a specified lob descriptor.
|
|
IfxCblob(java.sql.Connection conn,
java.lang.String str,
java.lang.String sbspaceName)
Creates an IfxCblob instance with a given connection and a string
of data and a specified smart blob space.
|
|
IfxCblob(IfxConnection con) |
|
IfxCblob(IfxConnection connection,
IfxLocator locator)
Creates an IfxCblob instance with a given connection and a locator.
|
|
IfxCblob(IfxConnection connection,
IfxLocator locator,
int mode)
Creates an IfxCblob instance with a given connection and a locator.
|
|
IfxCblob(IfxLocator locator)
Creates an IfxCblob instance with the given locator.
|
protected |
IfxCblob(IfxTmpFile tempFile) |
|
IfxCblob(java.io.InputStream fin)
Creates an IfxCblob 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.
|
void |
free() |
java.io.InputStream |
getAsciiStream()
Gets the smart large object contents as an ASCII stream.
|
java.io.InputStream |
getBinaryStream(long pos,
long length)
Returns a new stream with partial blob data as given by the start position
and length
|
java.io.Reader |
getCharacterStream()
Gets the smart large object contents as a Unicode stream.
|
java.io.Reader |
getCharacterStream(long pos,
long length) |
protected short |
getIfxLobType() |
IfxLocator |
getLocator()
Gets the smart large object locator from the clob object.
|
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 position,
long length) |
protected java.io.InputStream |
getStream() |
protected java.io.InputStream |
getStream(long pos,
long length) |
protected java.io.InputStream |
getStreamImd() |
java.lang.String |
getSubString(long position,
int length)
Returns a copy of the substring of the smart large object at the
requested position.
|
long |
length()
Gets the length of the character smart large object in characters.
|
protected void |
loadSmBlob() |
long |
position(java.sql.Clob searchstr,
long start)
Determines the character position at which the given substring occurs.
|
long |
position(java.lang.String searchstr,
long start)
Determines the character position at which the given substring 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 |
setAsciiStream(long pos)
Retrieves a stream to be used to write Ascii characters to the CLOB value
that this Clob object represents, starting at position pos.
|
void |
setAsciiStream(long position,
java.io.InputStream fin,
int length)
Writes ascii stream of data from an InputStream to an already existing
smart large blob object.
|
protected int |
setBuffer(byte[] buffer) |
protected int |
setBuffer(byte[] buffer,
int offset,
int length) |
java.io.Writer |
setCharacterStream(long pos)
Retrieves a stream to be used to write a stream of Unicode characters to
the CLOB value that this Clob object represents, at position pos.
|
protected void |
setConnection(IfxConnection conn) |
protected void |
setIfxLobType(short type) |
protected void |
setLoadFlag() |
protected void |
setLocator(IfxLocator locator) |
protected void |
setMode(int mode) |
protected void |
setSize(long size) |
protected void |
setStream(java.io.InputStream fin,
int length) |
int |
setString(long pos,
java.lang.String str)
Writes the given Java String to the CLOB value that this Clob object
designates at the position pos.
|
int |
setString(long pos,
java.lang.String str,
int offset,
int len)
Writes len characters of str, starting at character offset,
to the CLOB value that this Clob represents.
|
void |
setSubString(long position,
java.lang.String str,
int length)
Writes data from a string to an already existing
smart large blob object.
|
void |
truncate(long size)
This method truncates the smart large object at the given position.
|
protected void |
verifySmbMode()
Verifying that
the IfxSmartBlob Object was created for writing
and not already closed .
|
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 IfxConnection conn
protected boolean isBlob_loaded
protected 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 IfxCblob()
public IfxCblob(IfxLocator locator)
locator - The locator that references the smart large objectpublic IfxCblob(IfxConnection con) throws java.sql.SQLException
java.sql.SQLExceptionpublic IfxCblob(IfxConnection connection, IfxLocator locator, int mode) throws java.sql.SQLException
connection - The IfxConnection objectlocator - The locator that references the smart large objectjava.sql.SQLExceptionpublic IfxCblob(IfxConnection connection, IfxLocator locator) throws java.sql.SQLException
connection - The IfxConnection objectlocator - The locator that references the smart large objectjava.sql.SQLExceptionprotected IfxCblob(byte[] buffer)
public IfxCblob(java.sql.Connection c,
byte[] buffer)
throws java.sql.SQLException
conn - the Connection objectbuffer - the data bufferjava.sql.SQLException - if object instance cannot be instantiatedpublic IfxCblob(java.io.InputStream fin)
fin - The input stream for this smart large objectprotected IfxCblob(IfxTmpFile tempFile)
public IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length)
throws java.sql.SQLException
conn - The IfxConnection object.fin - The input stream from which the data will be written into
the smart large object.length - Number of bytes to be written.java.sql.SQLException - if object instance cannot be instantiated.public IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
java.lang.String sbspaceName)
throws java.sql.SQLException
conn - The IfxConnection object.fin - The input stream from which the data will be written into
the smart large object.length - Number of bytes to be written.sbspaceName - specified smart blob space name.java.sql.SQLException - if object instance cannot be instantiated.public IfxCblob(java.sql.Connection conn,
java.io.InputStream fin,
int length,
IfxLobDescriptor loDesc)
throws java.sql.SQLException
conn - The IfxConnection object.fin - The input stream from which the data will be written into
the smart large object.length - Number of bytes to be written.loDesc - user created lob descriptor.java.sql.SQLException - if object instance cannot be instantiated.public IfxCblob(java.sql.Connection conn,
java.lang.String str)
throws java.sql.SQLException
conn - The IfxConnection object.str - The String from which the data will be written to smart blob.java.sql.SQLException - if object instance cannot be instantiated.public IfxCblob(java.sql.Connection conn,
java.lang.String str,
java.lang.String sbspaceName)
throws java.sql.SQLException
conn - The IfxConnection object.str - The String from which the data will be written to smart blob.sbspaceName - specified smart blob space name.java.sql.SQLException - if object instance cannot be instantiated.public IfxCblob(java.sql.Connection conn,
java.lang.String str,
IfxLobDescriptor loDesc)
throws java.sql.SQLException
conn - The IfxConnection object.str - The string from which the data will be written to smart blob.loDesc - user defined lob descriptor.java.sql.SQLException - if object instance cannot be instantiated.public IfxLocator getLocator() throws java.sql.SQLException
java.sql.SQLException - if the object type is not a BLOB or CLOB.public long length()
throws java.sql.SQLException
length in interface java.sql.Clobjava.sql.SQLExceptionpublic java.lang.String getSubString(long position,
int length)
getSubString in interface java.sql.Clobposition - The position at which to start searching.length - The number of consecutive characters to be copied.public java.io.Reader getCharacterStream()
throws java.sql.SQLException
getCharacterStream in interface java.sql.Clobjava.sql.SQLExceptionpublic java.io.Reader getCharacterStream(long pos,
long length)
throws java.sql.SQLException
getCharacterStream in interface java.sql.Clobjava.sql.SQLExceptionpublic java.io.InputStream getAsciiStream()
throws java.sql.SQLException
getAsciiStream in interface java.sql.Clobjava.sql.SQLException - if there is a problem getting the stream.public long position(java.lang.String searchstr,
long start)
throws java.sql.SQLException
position in interface java.sql.Clobsearchstr - The substring for which you want to search.start - The position at which searching begins.java.sql.SQLException - if the string cannot be read or the the index
is out of bounds.public long position(java.sql.Clob searchstr,
long start)
throws java.sql.SQLException
position in interface java.sql.Clobsearchstr - The substring for which you want to search.start - The position at which searching begins.java.sql.SQLException - if there is an error accessing the CLOBpublic void setAsciiStream(long position,
java.io.InputStream fin,
int length)
throws java.sql.SQLException
postion - Position at which smart large object will be written.fin - InputStreamlength - Number of bytes to be written from the input stream.java.sql.SQLException - if the type is not a CLOB, the large object
is invalid or the large object cannot be opened.public void setSubString(long position,
java.lang.String str,
int length)
throws java.sql.SQLException
postion - Position at which smart large object will be written.str - The string which the data will be written.length - Number of bytes to be written into smart large object.java.sql.SQLException - if the type is not a CLOB, the large object
is invalid or the large object cannot be opened.public void close()
throws java.sql.SQLException
java.sql.SQLException - if there was an error closing the large object.public long seek(long offset,
int whence)
throws java.sql.SQLException
offset - Number of bytes from the location specified in the whence
parameter.whence - defines 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 the object is not a smart large object.public long where()
throws java.sql.SQLException
java.sql.SQLException - if the object is not a smart large object.public IfxLoStat getLoStat() throws java.sql.SQLException
java.sql.SQLException - if the object is not a smart large object.public void truncate(long size)
throws java.sql.SQLException
truncate in interface java.sql.Clobsize - Position at which the truncation will occur.java.sql.SQLException - if the object is not a smart large object.public int setString(long pos,
java.lang.String str)
throws java.sql.SQLException
setString in interface java.sql.Clobstr - the string to be written to the CLOB value that this Clob designatesjava.sql.SQLException - if there is an error accessing the CLOB valuepublic int setString(long pos,
java.lang.String str,
int offset,
int len)
throws java.sql.SQLException
setString in interface java.sql.Clobpos - the position at which to start writing to this CLOB objectstr - the string to be written to the CLOB value that this Clob object representsoffset - the offset into str to start reading the characters to be writtenlen - the number of characters to be writtenjava.sql.SQLExceptionpublic java.io.OutputStream setAsciiStream(long pos)
throws java.sql.SQLException
setAsciiStream in interface java.sql.Clobpos - the position at which to start writing to this CLOB objectjava.sql.SQLException - if there is an error accessing the CLOB valuepublic java.io.Writer setCharacterStream(long pos)
throws java.sql.SQLException
setCharacterStream in interface java.sql.Clobpos - the position at which to start writing to the CLOB valuejava.sql.SQLException - if there is an error accessing the CLOB valuepublic void free()
throws java.sql.SQLException
free in interface java.sql.Clobjava.sql.SQLExceptionprotected void setLocator(IfxLocator locator) throws java.sql.SQLException
java.sql.SQLExceptionprotected void setIfxLobType(short type)
protected void setSize(long size)
protected void setConnection(IfxConnection conn)
protected void setLoadFlag()
protected short getIfxLobType()
protected void setMode(int mode)
protected byte[] getPortion(long position,
long length)
protected 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 pos,
long length)
throws java.sql.SQLException
java.sql.SQLExceptionpublic java.io.InputStream getBinaryStream(long pos,
long length)
throws java.sql.SQLException
pos - length - java.sql.SQLExceptionprotected void setStream(java.io.InputStream fin,
int length)
throws java.sql.SQLException
java.sql.SQLExceptionprotected int setBuffer(byte[] buffer)
throws java.sql.SQLException
java.sql.SQLExceptionprotected int setBuffer(byte[] buffer,
int offset,
int length)
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 checkIfFreed()
throws java.sql.SQLException
java.sql.SQLException