public class PgClob extends AbstractBlobClob implements Clob
conn| Constructor and Description |
|---|
PgClob(BaseConnection conn,
long oid) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
getAsciiStream()
Retrieves the
CLOB value designated by this Clob
object as an ascii stream. |
Reader |
getCharacterStream()
Retrieves the
CLOB value designated by this Clob
object as a java.io.Reader object (or as a stream of
characters). |
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 i,
int j)
Retrieves a copy of the specified substring
in the
CLOB value
designated by this Clob object. |
long |
position(Clob pattern,
long start)
This should be simply passing the byte value of the pattern Blob
|
long |
position(String pattern,
long start)
For now, this is not implemented.
|
OutputStream |
setAsciiStream(long pos)
Retrieves a stream to be used to write Ascii characters to the
CLOB value that this Clob object represents,
starting at position pos. |
Writer |
setCharacterStream(long pos)
Retrieves a stream to be used to write a stream of Unicode characters
to the
CLOB value that this Clob object
represents, at position pos. |
int |
setString(long pos,
String str)
Writes the given Java
String to the CLOB
value that this Clob object designates at the position
pos. |
int |
setString(long pos,
String str,
int offset,
int len)
Writes
len characters of str, starting
at character offset, to the CLOB value
that this Clob represents. |
addSubLO, assertPosition, assertPosition, checkFreed, free, getBinaryStream, getBytes, getLo, length, position, position, setBinaryStream, truncatepublic PgClob(BaseConnection conn, long oid) throws SQLException
SQLExceptionpublic Reader getCharacterStream(long pos, long length) throws SQLException
java.sql.ClobReader 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 ClobSQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic int setString(long pos,
String str)
throws SQLException
java.sql.ClobString to the CLOB
value that this Clob object designates at the position
pos. The string will overwrite the existing characters
in the Clob object starting at the position
pos. If the end of the Clob value is reached
while writing the given string, then the length of the Clob
value will be increased to accommodate the extra characters.
Note: If the value specified for pos
is greater then the length+1 of the CLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setString in interface Clobpos - the position at which to start writing to the CLOB
value that this Clob object represents;
The first position is 1str - the string to be written to the CLOB
value that this Clob designatesSQLException - if there is an error accessing the
CLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic int setString(long pos,
String str,
int offset,
int len)
throws SQLException
java.sql.Cloblen characters of str, starting
at character offset, to the CLOB value
that this Clob represents. The string will overwrite the existing characters
in the Clob object starting at the position
pos. If the end of the Clob value is reached
while writing the given string, then the length of the Clob
value will be increased to accommodate the extra characters.
Note: If the value specified for pos
is greater then the length+1 of the CLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setString in interface Clobpos - the position at which to start writing to this
CLOB object; The first position is 1str - the string to be written to the CLOB
value that this Clob object representsoffset - the offset into str to start reading
the characters to be writtenlen - the number of characters to be writtenSQLException - if there is an error accessing the
CLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic OutputStream setAsciiStream(long pos) throws SQLException
java.sql.ClobCLOB value that this Clob object represents,
starting at position pos. Characters written to the stream
will overwrite the existing characters
in the Clob object starting at the position
pos. If the end of the Clob value is reached
while writing characters to the stream, then the length of the Clob
value will be increased to accommodate the extra characters.
Note: If the value specified for pos
is greater then the length+1 of the CLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setAsciiStream in interface Clobpos - the position at which to start writing to this
CLOB object; The first position is 1SQLException - if there is an error accessing the
CLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodClob.getAsciiStream()public Writer setCharacterStream(long pos) throws SQLException
java.sql.ClobCLOB value that this Clob object
represents, at position pos. Characters written to the stream
will overwrite the existing characters
in the Clob object starting at the position
pos. If the end of the Clob value is reached
while writing characters to the stream, then the length of the Clob
value will be increased to accommodate the extra characters.
Note: If the value specified for pos
is greater then the length+1 of the CLOB value then the
behavior is undefined. Some JDBC drivers may throw a
SQLException while other drivers may support this
operation.
setCharacterStream in interface Clobpos - the position at which to start writing to the
CLOB value; The first position is 1SQLException - if there is an error accessing the
CLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodClob.getCharacterStream()public InputStream getAsciiStream() throws SQLException
java.sql.ClobCLOB value designated by this Clob
object as an ascii stream.getAsciiStream in interface Clobjava.io.InputStream object containing the
CLOB dataSQLException - if there is an error accessing the
CLOB valueSQLFeatureNotSupportedException - if the JDBC driver does not support
this methodClob.setAsciiStream(long)public Reader getCharacterStream() throws SQLException
java.sql.ClobCLOB value designated by this Clob
object as a java.io.Reader object (or as a stream of
characters).getCharacterStream in interface Clobjava.io.Reader object containing the
CLOB dataSQLException - if there is an error accessing the
CLOB valueSQLFeatureNotSupportedException - if the JDBC driver does not support
this methodClob.setCharacterStream(long)public String getSubString(long i, int j) throws SQLException
java.sql.ClobCLOB value
designated by this Clob object.
The substring begins at position
pos and has up to length consecutive
characters.getSubString in interface Clobi - the first character of the substring to be extracted.
The first character is at position 1.j - the number of consecutive characters to be copied;
the value for length must be 0 or greaterString that is the specified substring in
the CLOB value designated by this Clob objectSQLException - if there is an error accessing the
CLOB value; if pos is less than 1 or length is
less than 0SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic long position(String pattern, long start) throws SQLException
position in interface Clobpattern - the substring for which to searchstart - the position at which to begin searching; the first position
is 1SQLException - if there is an error accessing the
CLOB value or if pos is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodpublic long position(Clob pattern, long start) throws SQLException
position in interface Clobpattern - the Clob object for which to searchstart - the position at which to begin searching; the first
position is 1Clob object appears
or -1 if it is not present; the first position is 1SQLException - if there is an error accessing the
CLOB value or if start is less than 1SQLFeatureNotSupportedException - if the JDBC driver does not support
this methodCopyright © 2018 PostgreSQL Global Development Group. All rights reserved.