CLOB type.
An SQL CLOB is a built-in type
that stores a Character Large Object as a column value in a row of
a database table.
By default, drivers implement a Clob object using an SQL
locator(CLOB), which means that a Clob object
contains a logical pointer to the SQL CLOB data rather than
the data itself. A Clob object is valid for the duration
of the transaction in which it was created.
The Clob interface provides methods for getting the
length of an SQL CLOB (Character Large Object) value,
for materializing a CLOB value on the client, and for
searching for a substring or CLOB object within a
CLOB value.
Methods in the interfaces ResultSet,
CallableStatement, and PreparedStatement, such as
getClob and setClob allow a programmer to
access an SQL CLOB value. In addition, this interface
has methods for updating a CLOB value.
To release resources used by the Clob object, applications must call
either the free() or the close() method. Any attempt to
invoke a method other than free() or close() after the
Clob object has been closed, will result in a SQLException
being thrown.
All methods on the Clob interface must be
fully implemented if the JDBC driver supports the data type.
| Modifier and Type | Method and Description |
|---|---|
| public default void | close()
Implements java. Closes and releases the resources held by this |
| public void | |
| public InputStream | Returns: ajava.io.InputStream object containing the
CLOB dataRetrieves the |
| public Reader | Returns: ajava.io.Reader object containing the
CLOB dataRetrieves the |
| public Reader | Returns: Reader through which
the partial Clob value can be read.the offset to the first character of the partial value to
be retrieved. The first character in the Clob is at position 1. pos, long the length in characters of the partial value to be retrieved. length)Returns a |
| public String | Returns: aString that is the specified substring in
the CLOB value designated by this Clob objectthe first character of the substring to be extracted.
The first character is at position 1. pos, int the number of consecutive characters to be copied;
the value for length must be 0 or greater length)Retrieves a copy of the specified substring
in the |
| public long | Returns: length of theCLOB in charactersRetrieves the number of characters
in the |
| public long | Returns: the position at which the substring appears or -1 if it is not present; the first position is 1the substring for which to search searchstr, long the position at which to begin searching;
the first position is 1 start)Retrieves the character position at which the specified substring
|
| public long | Returns: the position at which theClob object appears
or -1 if it is not present; the first position is 1the searchstr, long Clob object for which to searchthe position at which to begin searching; the first
position is 1 start)Retrieves the character position at which the specified
|
| public OutputStream | Returns: the stream to which ASCII encoded characters can be writtenthe position at which to start writing to this
pos)CLOB object; The first position is 1Retrieves a stream to be used to write Ascii characters to the
|
| public Writer | Returns: a stream to which Unicode encoded characters can be writtenthe position at which to start writing to the
pos)CLOB value; The first position is 1Retrieves a stream to be used to write a stream of Unicode characters
to the |
| public int | Returns: the number of characters writtenthe position at which to start writing to the pos, String CLOB
value that this Clob object represents;
the first position is 1.the string to be written to the str)CLOB
value that this Clob designatesWrites the given Java |
| public int | Returns: the number of characters writtenthe position at which to start writing to this
pos, String CLOB object; The first position is 1the string to be written to the str, int CLOB
value that this Clob object representsthe offset into offset, int str to start reading
the characters to be writtenthe number of characters to be written len)Writes |
| public void | truncate(long
the length, in characters, to which the len)CLOB value
should be truncatedTruncates the |
| close | back to summary |
|---|---|
| public default void close() throws SQLException Implements java. Closes and releases the resources held by this
If the Implementation Specification The default implementation calls the
| |
| free | back to summary |
|---|---|
| public void free() throws SQLException Closes and releases the resources held by this
If the
| |
| getAsciiStream | back to summary |
|---|---|
| public InputStream getAsciiStream() throws SQLException Retrieves the
| |
| getCharacterStream | back to summary |
|---|---|
| public Reader getCharacterStream() throws SQLException Retrieves the
| |
| getCharacterStream | back to summary |
|---|---|
| public Reader getCharacterStream(long pos, long length) throws SQLException Returns a
| |
| getSubString | back to summary |
|---|---|
| public String getSubString(long pos, int length) throws SQLException Retrieves a copy of the specified substring
in the
| |
| length | back to summary |
|---|---|
| public long length() throws SQLException Retrieves the number of characters
in the
| |
| position | back to summary |
|---|---|
| public long position(String searchstr, long start) throws SQLException Retrieves the character position at which the specified substring
| |
| position | back to summary |
|---|---|
| public long position(Clob searchstr, long start) throws SQLException Retrieves the character position at which the specified
| |
| setAsciiStream | back to summary |
|---|---|
| public OutputStream setAsciiStream(long pos) throws SQLException Retrieves a stream to be used to write Ascii characters to the
Note If the value specified for
| |
| setCharacterStream | back to summary |
|---|---|
| public Writer setCharacterStream(long pos) throws SQLException Retrieves a stream to be used to write a stream of Unicode characters
to the Note If the value specified for
| |
| setString | back to summary |
|---|---|
| public int setString(long pos, String str) throws SQLException Writes the given Java Note If the value specified for
| |
| setString | back to summary |
|---|---|
| public int setString(long pos, String str, int offset, int len) throws SQLException Writes Note If the value specified for
| |
| truncate | back to summary |
|---|---|
| public void truncate(long len) throws SQLException Truncates the Note If the value specified for
| |