public class Clob extends Lob implements Clob
| Modifier and Type | Field and Description |
|---|---|
protected InputStream |
asciiStream_ |
protected Reader |
characterStream_ |
protected String |
encoding_ |
protected String |
string_ |
protected InputStream |
unicodeStream_ |
protected byte[] |
utf8String_ |
agent_, ASCII_STREAM, BINARY_STREAM, BINARY_STRING, CHARACTER_STREAM, columnName, dataType_, INVALID_LOCATOR, isValid_, LOB_OBJECT_LENGTH_UNKNOWN_YET, LOCATOR, locator_, locatorProcs_, STRING, UNICODE_STREAM| Constructor and Description |
|---|
Clob(Agent agent,
byte[] unconvertedBytes,
String charsetName,
int dataOffset,
String columnName) |
Clob(Agent agent,
InputStream inputStream,
String encoding,
int length,
String columnName) |
Clob(Agent agent,
InputStream inputStream,
String encoding,
String columnName)
Create a
Clob of unknown length with the specified
encoding. |
Clob(Agent agent,
int locator,
String columnName)
Create a
Clob object for a Clob value stored
on the server and indentified by locator. |
Clob(Agent agent,
Reader reader,
int length,
String columnName) |
Clob(Agent agent,
Reader reader,
String columnName)
Create a
Clob of unknown length. |
Clob(Agent agent,
String string,
String columnName) |
| Modifier and Type | Method and Description |
|---|---|
void |
convertFromAsciiToCharacterStream() |
protected Clob |
createClobWrapper(Clob clob,
String columnName) |
void |
free()
This method frees the
Clob object and releases the resources the resources
that it holds. |
InputStream |
getAsciiStream() |
Reader |
getCharacterStream() |
Reader |
getCharacterStream(long pos,
long length)
Returns a
Reader object that contains a partial
Clob value, starting with the character specified by pos,
which is length characters in length. |
String |
getString() |
String |
getSubString(long pos,
int length)
Returns a copy of the specified substring
in the
CLOB value
designated by this Clob object. |
InputStream |
getUnicodeStream() |
int |
getUTF8Length() |
byte[] |
getUtf8String() |
boolean |
isAsciiStream() |
boolean |
isCharacterStream() |
boolean |
isString() |
boolean |
isUnicodeStream() |
long |
length() |
protected void |
materializeStream()
Materialize the stream used for input to the database.
|
long |
position(Clob searchstr,
long start) |
long |
position(String searchstr,
long start) |
OutputStream |
setAsciiStream(long pos) |
Writer |
setCharacterStream(long pos) |
int |
setString(long pos,
String str) |
int |
setString(long pos,
String str,
int offset,
int len) |
int |
setStringX(long pos,
String str,
int offset,
int len) |
void |
truncate(long len) |
checkPosAndLength, checkValidity, completeLocalCommit, completeLocalRollback, finalize, getAgent, getLocator, incrementUpdateCount, isLayerBStreamingPossible, isLengthObtained, isLocator, listenToUnitOfWork, materializeStream, willBeLayerBStreamedprotected String string_
protected InputStream asciiStream_
protected InputStream unicodeStream_
protected Reader characterStream_
protected byte[] utf8String_
protected String encoding_
public Clob(Agent agent, byte[] unconvertedBytes, String charsetName, int dataOffset, String columnName) throws SqlException
SqlExceptionpublic Clob(Agent agent, InputStream inputStream, String encoding, int length, String columnName) throws SqlException
SqlExceptionpublic Clob(Agent agent, InputStream inputStream, String encoding, String columnName) throws SqlException
Clob of unknown length with the specified
encoding.
This constructor was added to support the JDBC 4 length less overloads.
Note that a Clob created with this constructor is made for
input to the database only. Do not pass it out to the user!agent - inputStream - the data to insertencoding - encoding to use for characters. Only "ISO-8859-1" is
allowed.SqlExceptionpublic Clob(Agent agent, int locator, String columnName)
Clob object for a Clob value stored
on the server and indentified by locator.agent - context for this Clob
object (incl. connection).locator - reference id to Clob value on server.public Clob(Agent agent, Reader reader, String columnName)
Clob of unknown length.
This constructor was added to support the JDBC 4 length less overloads.
Note that a Clob created with this constructor is made for
input to the database only. Do not pass it out to the user!agent - reader - the data to insertpublic long length()
throws SQLException
length in interface Cloblength in class LobSQLExceptionpublic String getSubString(long pos, int length) throws SQLException
CLOB value
designated by this Clob object.
The substring begins at position
pos and has up to length consecutive
characters. The starting position must be between 1 and the length
of the CLOB plus 1. This allows for zero-length CLOB values, from
which only zero-length substrings can be returned.
If a larger length is requested than there are characters available,
characters to the end of the CLOB are returned.getSubString in interface 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 copiedString that is the specified substring in
the CLOB value designated by this Clob objectSQLException - if there is an error accessing the
CLOB
NOTE: If the starting position is the length of the CLOB plus 1,
zero characters are returned regardless of the length requested.public Reader getCharacterStream() throws SQLException
getCharacterStream in interface ClobSQLExceptionpublic InputStream getAsciiStream() throws SQLException
getAsciiStream in interface ClobSQLExceptionpublic long position(String searchstr, long start) throws SQLException
position in interface ClobSQLExceptionpublic long position(Clob searchstr, long start) throws SQLException
position in interface ClobSQLExceptionpublic int setString(long pos,
String str)
throws SQLException
setString in interface ClobSQLExceptionpublic int setString(long pos,
String str,
int offset,
int len)
throws SQLException
setString in interface ClobSQLExceptionpublic int setStringX(long pos,
String str,
int offset,
int len)
throws SqlException
SqlExceptionpublic OutputStream setAsciiStream(long pos) throws SQLException
setAsciiStream in interface ClobSQLExceptionpublic Writer setCharacterStream(long pos) throws SQLException
setCharacterStream in interface ClobSQLExceptionpublic void truncate(long len)
throws SQLException
truncate in interface ClobSQLExceptionpublic void free()
throws SQLException
Clob object and releases the resources the resources
that it holds. The object is invalid once the free method
is called. If free is called multiple times, the
subsequent calls to free are treated as a no-op.free in interface ClobSQLException - if an error occurs releasing
the Clob's resourcespublic Reader getCharacterStream(long pos, long length) throws SQLException
Reader object that contains a partial
Clob value, starting with the character specified by pos,
which is length characters in length.getCharacterStream in interface Clobpos - the offset to the first character of the partial value to
be retrieved. The first character in the Clob is at position 1.length - the length in characters of the partial value to be
retrieved.Reader through which the partial Clob
value can be read.SQLException - if pos is less than 1 or if pos is greater than the
number of
characters in the Clob or if pos + length is greater than
the number of
characters in the Clobpublic boolean isString()
public boolean isAsciiStream()
public boolean isCharacterStream()
public boolean isUnicodeStream()
public InputStream getUnicodeStream()
public String getString()
public byte[] getUtf8String()
public int getUTF8Length()
throws SqlException
SqlExceptionprotected Clob createClobWrapper(Clob clob, String columnName) throws SqlException
SqlExceptionpublic void convertFromAsciiToCharacterStream()
throws SqlException
SqlExceptionprotected void materializeStream()
throws SqlException
materializeStream in class LobSqlExceptionCopyright © 2010-2015 Pivotal Software, Inc. All rights reserved.