The methods defined by java. must be implemented on top of
this interface. In addition, there are some methods to aid internal tasks and
organization, like transferring one internal Clob representation to another
one.
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public long | Returns: Number of characters in the Clob, or-1 if the length is
currently unknown (not cached).Gets the number of characters in the Clob if it is already known. |
| public Reader | Returns: AReader serving the content of the Clob.character position. The first character is at
position characterPosition)1.Returns an internal reader for the Clob content, initialized at the specified character position. |
| public InputStream | Returns: A stream of bytes representing the content of the Clob, initialized at byte position 0.Returns a stream serving the raw bytes of the Clob. |
| public Reader | Returns: AReader serving the content of the Clob.character position. The first character is at
position characterPosition)1.Returns a reader for the Clob content, initialized at the specified character position. |
| public long | |
| public Writer | Returns: A writer initialized at the specified character position.the starting character position. The first character is
at position charPos)1.Returns a writer to write data into the Clob. |
| public long | Returns: The number of characters inserted.the string to insert str, long the character position the string will be inserted at. Must be
between pos)1 and clob.length() +1, inclusive.Inserts the given string at the specified character position. |
| public boolean | |
| public boolean | Returns: true if the Clob is intended to be writable,
false if modifying the Clob is definitely not possible.Tells if the Clob representation is intended to be writable. |
| public void | |
| public void |
| getCharLength | back to summary |
|---|---|
| public long getCharLength() throws IOException, SQLException Gets the number of characters in the Clob.
| |
| getCharLengthIfKnown | back to summary |
|---|---|
| public long getCharLengthIfKnown() Gets the number of characters in the Clob if it is already known.
This method will not do any work to obtain the length if it isn't
already known. Due to special handling of zero in the code, this method
will return If a positive value is returned, it is expected to be equal to the actual length of the Clob (i.e., no stale values must be returned).
| |
| getInternalReader | back to summary |
|---|---|
| public Reader getInternalReader(long characterPosition) throws IOException, SQLException Returns an internal reader for the Clob content, initialized at the specified character position.
This method can return a shared reader object, avoiding instantiation and
repositioning costs for internal operations where the stream itself is
not published to the end-user. One such example is
| |
| getRawByteStream | back to summary |
|---|---|
| public InputStream getRawByteStream() throws IOException, SQLException Returns a stream serving the raw bytes of the Clob. Note that it is up to the caller of this method to handle the issue of encoding. There is no predetermined encoding associated with this byte stream, it is up to the Clob representation which one it uses. This stream may be an internal store stream, and should not be directly published to the end user (returned through the JDBC API). There are three reasons for this:
The primary use of this method is to clone the Clob contents without going via char (or String). Make sure the clone uses the same encoding as the original Clob representation.
| |
| getReader | back to summary |
|---|---|
| public Reader getReader(long characterPosition) throws IOException, SQLException Returns a reader for the Clob content, initialized at the specified character position.
| |
| getUpdateCount | back to summary |
|---|---|
| public long getUpdateCount() Returns the update count of the Clob. The update count is increased each time a modification of the Clob content is made.
| |
| getWriter | back to summary |
|---|---|
| public Writer getWriter(long charPos) throws IOException, SQLException Returns a writer to write data into the Clob.
The semantics of the writer is the same as for
| |
| insertString | back to summary |
|---|---|
| public long insertString(String str, long pos) throws IOException, SQLException Inserts the given string at the specified character position.
The behavior of this method can be defined by the following examples on
the Clob
| |
| isReleased | back to summary |
|---|---|
| public boolean isReleased() Tells if the the Clob has been released.
Depending on the context, a Clob is released either because the internal
representation has been changed, or because the Clob itself has been
closed. The former can happen when a user modifies a stream that is
currently represented as a store stream. The latter can happen if
| |
| isWritable | back to summary |
|---|---|
| public boolean isWritable() Tells if the Clob representation is intended to be writable.
Note that even if this method returns
| |
| release | back to summary |
|---|---|
| public void release() throws IOException, SQLException Frees the resources held by the internal Clob representation. After calling this method, all other operations on the Clob will be invalid and throw an exception.
| |
| truncate | back to summary |
|---|---|
public void truncate(long newLength) throws IOException, SQLException
| |