| java.lang.Object org.continuent.sequoia.common.protocol.StringClob
StringClob | public class StringClob implements java.sql.Clob,Serializable(Code) | | The representation (mapping) in the Java TM
programming language of an SQL CLOB value. 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
Clob 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 is was created.
Methods in the interfaces
java.sql.ResultSet ,
java.sql.CallableStatement , and
java.sql.PreparedStatement ,
such as getClob and setClob allow a programmer
to access an SQL CLOB value. 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 determining the position of a pattern of bytes within
a CLOB value. In addition, this interface has methods for
updating a CLOB value.
author: Nicolas Modrzyk author: Emmanuel Cecchet author: since: JDK 1.2 |
Method Summary | |
public java.io.InputStream | getAsciiStream() Retrieves the CLOB value designated by this
Clob instance as a stream. | public java.io.Reader | getCharacterStream() Materializes the CLOB value designated by this object
as a stream of Unicode character. | public String | getSubString(long sqlPos, int wantedLength) | public long | length() | public long | position(String searchstr, long start) Retrieves the character position at which the specified string
searchstr begins within the CLOB value that
this Clob object represents. | public long | position(java.sql.Clob searchstr, long start) Retrieves the character position at which the specified Clob
object searchstr begins within the CLOB value
that this Clob object represents. | public 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. | public 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. | public int | setString(long pos, String str) Writes the given Java String to the CLOB value that this Clob object
designates at the position pos. | public 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. | public void | truncate(long len) Truncates the CLOB value that this Clob designates to have a length of len
characters. |
StringClob | public StringClob(String data)(Code) | | Creates a new Clob instance.
Parameters: data - a String of character data |
getAsciiStream | public java.io.InputStream getAsciiStream() throws SQLException(Code) | | Retrieves the CLOB value designated by this
Clob instance as a stream.
a stream containing the CLOB data exception: SQLException - if there is an error accessing theCLOB value since: JDK 1.2 |
getCharacterStream | public java.io.Reader getCharacterStream() throws SQLException(Code) | | Materializes the CLOB value designated by this object
as a stream of Unicode character.
A reader object with all the data in the CLOB valuedesignated by this clob object as unicode characters. exception: SQLException - if there is an error accessing theCLOB value |
length | public long length() throws SQLException(Code) | | Returns the size of the CLOB value designated by this
Clob object
length of the CLOB value that this clob represents exception: SQLException - if there is an error accessing the length of theCLOB since: JDK 1.2 |
position | public long position(String searchstr, long start) throws SQLException(Code) | | Retrieves the character position at which the specified string
searchstr begins within the CLOB value that
this Clob object represents. The search for
searchstr begins at position start .
Parameters: searchstr - the byte array for which to search Parameters: start - the position at which to begin searching; the first positionis 1 the position at which the pattern appears, else -1 exception: SQLException - if there is an error accessing theCLOB since: JDK 1.2 |
position | public long position(java.sql.Clob searchstr, long start) throws SQLException(Code) | | Retrieves the character position at which the specified Clob
object searchstr begins within the CLOB value
that this Clob object represents. The search for
searchstr begins at position start .
Parameters: searchstr - the byte array for which to search Parameters: start - the position at which to begin searching; the first positionis 1 the position at which the pattern appears, else -1 exception: SQLException - if there is an error accessing theCLOB since: JDK 1.2 |
setAsciiStream | public OutputStream setAsciiStream(long pos) throws SQLException(Code) | | Retrieves a stream to be used to write Ascii characters to the CLOB value
that this Clob object represents, starting at position pos.
Parameters: pos - the position where to start the stream the ascii outputstream to this clob object throws: SQLException - if there is an error accessing the clob |
setCharacterStream | public Writer setCharacterStream(long pos) throws SQLException(Code) | | 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.
Parameters: pos - the position where to start the writer the writer to this clob object throws: SQLException - if there is an error accessing the clob |
setString | public int setString(long pos, String str) throws SQLException(Code) | | Writes the given Java String to the CLOB value that this Clob object
designates at the position pos.
Parameters: pos - the position where to set the string Parameters: str - string to insert in the clob return value throws: SQLException - if there is an error accessing the clob |
setString | public int setString(long pos, String str, int offset, int len) throws SQLException(Code) | | Writes len characters of str, starting at character offset, to the CLOB
value that this Clob represents.
Parameters: pos - the position Parameters: str - the string Parameters: offset - the offset Parameters: len - the length return value throws: SQLException - if there is an error accessing the clob |
truncate | public void truncate(long len) throws SQLException(Code) | | Truncates the CLOB value that this Clob designates to have a length of len
characters.
Parameters: len - the length throws: SQLException - if there is an error accessing the clob |
|
|