|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.types.ClobImpl
public class ClobImpl
This object holds a chunk of character data and implements the JDBC Clob interface. This object presents a streaming interface but actually encapsulates the entire clob object. Connectors can construct this object when dealing with large objects.
| Field Summary | |
|---|---|
static int |
DEFAULT_MAX_SIZE
|
| Constructor Summary | |
|---|---|
ClobImpl(char[] originalData)
Creates a MMClob object by copying the chars in originalData |
|
ClobImpl(java.sql.Clob clob)
Creates a MMClob object by using the CharacterStream of the Clob argument. |
|
ClobImpl(java.io.InputStream in,
java.nio.charset.Charset charSet,
int length)
|
|
ClobImpl(java.io.Reader reader,
int length)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares two MMClob objects for equality. |
void |
free()
|
java.io.InputStream |
getAsciiStream()
Gets the CLOB value designated by this Clob
object as a stream of Ascii bytes. |
java.io.Reader |
getCharacterStream()
Gets the CLOB value designated by this Clob
object as a Unicode stream. |
java.io.Reader |
getCharacterStream(long arg0,
long arg1)
|
java.lang.String |
getSubString(long pos,
int length)
Returns a copy of the specified substring in the CLOB value
designated by this Clob object. |
long |
length()
Returns the number of characters in the CLOB value
designated by this Clob object. |
long |
position(java.sql.Clob searchstr,
long start)
Determines the character position at which the specified Clob object searchstr appears in this
Clob object. |
long |
position(java.lang.String searchstr,
long start)
Determines the character position at which the specified substring searchstr appears in the SQL CLOB value
represented by this Clob object. |
java.io.OutputStream |
setAsciiStream(long pos)
|
java.io.Writer |
setCharacterStream(long pos)
|
int |
setString(long pos,
java.lang.String str)
|
int |
setString(long pos,
java.lang.String str,
int offset,
int len)
|
java.lang.String |
toString()
Returns a String that is a coma delimited list of up to the first 5 and last 5 chars of the Clob. |
void |
truncate(long len)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_MAX_SIZE
| Constructor Detail |
|---|
public ClobImpl(java.sql.Clob clob)
throws java.sql.SQLException
Clob argument.
clob - the Clob object to get the characters from.
java.sql.SQLExceptionpublic ClobImpl(char[] originalData)
originalData
originalData - the array of chars to copy into this MMClob object.
public ClobImpl(java.io.InputStream in,
java.nio.charset.Charset charSet,
int length)
throws java.sql.SQLException
java.sql.SQLException
public ClobImpl(java.io.Reader reader,
int length)
throws java.sql.SQLException
java.sql.SQLException| Method Detail |
|---|
public java.io.InputStream getAsciiStream()
throws java.sql.SQLException
CLOB value designated by this Clob
object as a stream of Ascii bytes.
getAsciiStream in interface java.sql.ClobCLOB data
java.sql.SQLException - if there is an error accessing the
CLOB value
public java.io.Reader getCharacterStream()
throws java.sql.SQLException
CLOB value designated by this Clob
object as a Unicode stream.
getCharacterStream in interface java.sql.ClobCLOB data
java.sql.SQLException - if there is an error accessing the
CLOB value
public java.lang.String getSubString(long pos,
int length)
throws java.sql.SQLException
CLOB value
designated by this Clob object.
The substring begins at position
pos and has up to length consecutive
characters.
getSubString in interface java.sql.Clobpos - the first character of the substring to be extracted.
The first character is at position 1.length - the number of consecutive characters to be copied
String that is the specified substring in
the CLOB value designated by this Clob object
java.sql.SQLException - if there is an error accessing the
CLOB
public long length()
throws java.sql.SQLException
CLOB value
designated by this Clob object.
length in interface java.sql.ClobCLOB in characters
java.sql.SQLException - if there is an error accessing the
length of the CLOB
public long position(java.sql.Clob searchstr,
long start)
throws java.sql.SQLException
Clob object searchstr appears in this
Clob object. The search begins at position
start.
position in interface java.sql.Clobsearchstr - the Clob object for which to searchstart - the position at which to begin searching; the first
position is 1
Clob object appears,
else -1; the first position is 1
java.sql.SQLException - if there is an error accessing the
CLOB value
public long position(java.lang.String searchstr,
long start)
throws java.sql.SQLException
searchstr appears in the SQL CLOB value
represented by this Clob object. The search
begins at position start.
position in interface java.sql.Clobsearchstr - the substring for which to searchstart - the position at which to begin searching; the first position
is 1
java.sql.SQLException - if there is an error accessing the
CLOB valuepublic boolean equals(java.lang.Object obj)
equals in class java.lang.ObjectObject.equals(Object)public java.lang.String toString()
toString in class java.lang.Object
public int setString(long pos,
java.lang.String str)
throws java.sql.SQLException
setString in interface java.sql.Clobjava.sql.SQLExceptionClob.setString(long, java.lang.String)
public int setString(long pos,
java.lang.String str,
int offset,
int len)
throws java.sql.SQLException
setString in interface java.sql.Clobjava.sql.SQLExceptionClob.setString(long, java.lang.String, int, int)
public java.io.OutputStream setAsciiStream(long pos)
throws java.sql.SQLException
setAsciiStream in interface java.sql.Clobjava.sql.SQLExceptionClob.setAsciiStream(long)
public java.io.Writer setCharacterStream(long pos)
throws java.sql.SQLException
setCharacterStream in interface java.sql.Clobjava.sql.SQLExceptionClob.setCharacterStream(long)
public void truncate(long len)
throws java.sql.SQLException
truncate in interface java.sql.Clobjava.sql.SQLExceptionClob.truncate(long)
public void free()
throws java.sql.SQLException
free in interface java.sql.Clobjava.sql.SQLException
public java.io.Reader getCharacterStream(long arg0,
long arg1)
throws java.sql.SQLException
getCharacterStream in interface java.sql.Clobjava.sql.SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||