public class IfxCblob
extends java.lang.Object
implements java.sql.Clob
By default, a CLOB is a transaction duration reference to a character large object.
Constructor and Description |
---|
IfxCblob()
Creates an IfxCblob instance.
|
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(com.informix.jdbc.IfxConnection connection,
IfxLocator locator)
Creates an IfxCblob instance with a given connection and a locator.
|
IfxCblob(com.informix.jdbc.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.
|
IfxCblob(java.io.InputStream fin)
Creates an IfxCblob instance with the given input stream.
|
Modifier and Type | Method and Description |
---|---|
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.Reader |
getCharacterStream()
Gets the smart large object contents as a Unicode stream.
|
java.io.Reader |
getCharacterStream(long pos,
long length) |
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.
|
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.
|
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.
|
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.
|
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.
|
long |
where()
This method returns the current seek position within the large object.
|
public IfxCblob()
public IfxCblob(IfxLocator locator)
locator
- The locator that references the smart large objectpublic IfxCblob(com.informix.jdbc.IfxConnection connection, IfxLocator locator, int mode) throws java.sql.SQLException
connection
- The IfxConnection objectlocator
- The locator that references the smart large objectjava.sql.SQLException
public IfxCblob(com.informix.jdbc.IfxConnection connection, IfxLocator locator) throws java.sql.SQLException
connection
- The IfxConnection objectlocator
- The locator that references the smart large objectjava.sql.SQLException
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 objectpublic 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()
length
in interface java.sql.Clob
public java.lang.String getSubString(long position, int length)
getSubString
in interface java.sql.Clob
position
- 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.Clob
java.sql.SQLException
public java.io.InputStream getAsciiStream() throws java.sql.SQLException
getAsciiStream
in interface java.sql.Clob
java.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.Clob
searchstr
- 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.Clob
searchstr
- 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.Clob
size
- 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.Clob
str
- 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.Clob
pos
- 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.SQLException
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
setAsciiStream
in interface java.sql.Clob
pos
- 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.Clob
pos
- 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.Clob
java.sql.SQLException
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
java.sql.SQLException