public class ClobImpl extends Object implements Clob
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.
| Constructor and Description |
|---|
ClobImpl(String string)
Constructor taking a string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
free()
Free the Blob object and releases 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 |
getSubString(long pos,
int length) |
long |
length() |
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) |
void |
truncate(long len) |
public ClobImpl(String string) throws IOException
string - The string.IOException - if an error occurspublic long length()
throws SQLException
length in interface ClobSQLExceptionpublic void truncate(long len)
throws SQLException
truncate in interface ClobSQLExceptionpublic InputStream getAsciiStream() throws SQLException
getAsciiStream in interface ClobSQLExceptionpublic OutputStream setAsciiStream(long pos) throws SQLException
setAsciiStream in interface ClobSQLExceptionpublic Reader getCharacterStream() throws SQLException
getCharacterStream in interface ClobSQLExceptionpublic Writer setCharacterStream(long pos) throws SQLException
setCharacterStream in interface ClobSQLExceptionpublic void free()
throws SQLException
free in interface ClobSQLException - if an error occurspublic Reader getCharacterStream(long pos, long length) throws SQLException
getCharacterStream in interface Clobpos - the offset to the first byte of the partial value to be retrieved.
The first byte in the Clob is at position 1length - the length in bytes of the partial value to be retrievedSQLExceptionpublic String getSubString(long pos, int length) throws SQLException
getSubString 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 long position(String searchstr, long start) throws SQLException
position in interface ClobSQLExceptionpublic long position(Clob searchstr, long start) throws SQLException
position in interface ClobSQLExceptionCopyright © 2020. All rights reserved.