blob: f1e9f5572b59b6decb30d1e84d672f03248c9d64 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.6.0_20) on Sun Jun 06 23:05:45 EDT 2010 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
JDBCClob (HSQLDB 2.0.0 API)
</TITLE>
<META NAME="date" CONTENT="2010-06-06">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../javadoc.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JDBCClob (HSQLDB 2.0.0 API)";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JDBCClob.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/hsqldb/jdbc/JDBCCallableStatement.html" title="class in org.hsqldb.jdbc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/hsqldb/jdbc/JDBCClobClient.html" title="class in org.hsqldb.jdbc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/hsqldb/jdbc/JDBCClob.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JDBCClob.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.hsqldb.jdbc</FONT>
<BR>
Class JDBCClob</H2>
<PRE>
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
<IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>org.hsqldb.jdbc.JDBCClob</B>
</PRE>
<DL>
<DT><B>All Implemented Interfaces:</B> <DD><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></DD>
</DL>
<DL>
<DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../org/hsqldb/jdbc/JDBCNClob.html" title="class in org.hsqldb.jdbc">JDBCNClob</A></DD>
</DL>
<HR>
<DL>
<DT><PRE>public class <B>JDBCClob</B><DT>extends <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A><DT>implements <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></DL>
</PRE>
<P>
The mapping in the Java<sup><font size=-2>TM</font></sup> programming language
for the SQL <code>CLOB</code> type.
An SQL <code>CLOB</code> 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 <code>Clob</code> object using an SQL
<code>locator(CLOB)</code>, which means that a <code>Clob</code> object
contains a logical pointer to the SQL <code>CLOB</code> data rather than
the data itself. A <code>Clob</code> object is valid for the duration
of the transaction in which it was created.
<P>The <code>Clob</code> interface provides methods for getting the
length of an SQL <code>CLOB</code> (Character Large Object) value,
for materializing a <code>CLOB</code> value on the client, and for
searching for a substring or <code>CLOB</code> object within a
<code>CLOB</code> value.
Methods in the interfaces <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/ResultSet.html?is-external=true" title="class or interface in java.sql"><CODE>ResultSet</CODE></A>,
<A HREF="http://java.sun.com/javase/6/docs/api/java/sql/CallableStatement.html?is-external=true" title="class or interface in java.sql"><CODE>CallableStatement</CODE></A>, and <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/PreparedStatement.html?is-external=true" title="class or interface in java.sql"><CODE>PreparedStatement</CODE></A>, such as
<code>getClob</code> and <code>setClob</code> allow a programmer to
access an SQL <code>CLOB</code> value. In addition, this interface
has methods for updating a <code>CLOB</code> value.
<p>
All methods on the <code>Clob</code> interface must be fully implemented if the
JDBC driver supports the data type.
<!-- start Release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Previous to 2.0, the HSQLDB driver did not implement Clob using an SQL
locator(CLOB). That is, an HSQLDB Clob object did not contain a logical
pointer to SQL CLOB data; rather it directly contained a representation of
the data (a String). As a result, an HSQLDB Clob object was itself
valid beyond the duration of the transaction in which is was created,
although it did not necessarily represent a corresponding value
on the database. Also, the interface methods for updating a CLOB value
were unsupported, with the exception of the truncate method,
in that it could be used to truncate the local value. <p>
Starting with 2.0, the HSQLDB driver fully supports both local and remote
SQL CLOB data implementations, meaning that an HSQLDB Clob object <em>may</em>
contain a logical pointer to remote SQL CLOB data (see <A HREF="../../../org/hsqldb/jdbc/JDBCClobClient.html" title="class in org.hsqldb.jdbc"><CODE>JDBCClobClient</CODE></A>) or it may directly contain a local representation of the
data (as implemented in this class). In particular, when the product is built
under JDK 1.6+ and the Clob instance is constructed as a result of calling
JDBCConnection.createClob(), then the resulting Clob instance is initially
disconnected (is not bound to the tranaction scope of the vending Connection
object), the data is contained directly and all interface methods for
updating the CLOB value are supported for local use until the first
invocation of free(); otherwise, an HSQLDB Clob's implementation is
determined at runtime by the driver, it is typically not valid beyond
the duration of the transaction in which is was created, and there no
standard way to query whether it represents a local or remote value.<p>
</div>
<!-- end release-specific documentation -->
<P>
<P>
<DL>
<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
<DT><B>Author:</B></DT>
<DD>boucherb@users</DD>
</DL>
<HR>
<P>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#JDBCClob(java.lang.String)">JDBCClob</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;data)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a new JDBCClob object wrapping the given character
sequence.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#free()">free</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method frees the <code>Clob</code> object and releases the resources the resources
that it holds.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getAsciiStream()">getAsciiStream</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
object as an ascii stream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getCharacterStream()">getCharacterStream</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
object as a <code>java.io.Reader</code> object (or as a stream of
characters).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getCharacterStream(long, long)">getCharacterStream</A></B>(long&nbsp;pos,
long&nbsp;length)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
with the character specified by pos, which is length characters in length.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getSubString(long, int)">getSubString</A></B>(long&nbsp;pos,
int&nbsp;length)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a copy of the specified substring
in the <code>CLOB</code> value
designated by this <code>Clob</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#length()">length</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the number of characters
in the <code>CLOB</code> value
designated by this <code>Clob</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#position(java.sql.Clob, long)">position</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A>&nbsp;searchstr,
long&nbsp;start)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the character position at which the specified
<code>Clob</code> object <code>searchstr</code> appears in this
<code>Clob</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;long</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#position(java.lang.String, long)">position</A></B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;searchstr,
long&nbsp;start)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves the character position at which the specified substring
<code>searchstr</code> appears in the SQL <code>CLOB</code> value
represented by this <code>Clob</code> object.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setAsciiStream(long)">setAsciiStream</A></B>(long&nbsp;pos)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a stream to be used to write Ascii characters to the
<code>CLOB</code> value that this <code>Clob</code> object represents,
starting at position <code>pos</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setCharacterStream(long)">setCharacterStream</A></B>(long&nbsp;pos)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Retrieves a stream to be used to write a stream of Unicode characters
to the <code>CLOB</code> value that this <code>Clob</code> object
represents, at position <code>pos</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setString(long, java.lang.String)">setString</A></B>(long&nbsp;pos,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes the given Java <code>String</code> to the <code>CLOB</code>
value that this <code>Clob</code> object designates at the position
<code>pos</code>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setString(long, java.lang.String, int, int)">setString</A></B>(long&nbsp;pos,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
int&nbsp;offset,
int&nbsp;len)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Writes <code>len</code> characters of <code>str</code>, starting
at character <code>offset</code>, to the <code>CLOB</code> value
that this <code>Clob</code> represents.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#truncate(long)">truncate</A></B>(long&nbsp;len)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Truncates the <code>CLOB</code> value that this <code>Clob</code>
designates to have a length of <code>len</code>
characters.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="JDBCClob(java.lang.String)"><!-- --></A><H3>
JDBCClob</H3>
<PRE>
public <B>JDBCClob</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;data)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Constructs a new JDBCClob object wrapping the given character
sequence. <p>
This constructor is used internally to retrieve result set values as
Clob objects, yet it must be public to allow access from other packages.
As such (in the interest of efficiency) this object maintains a reference
to the given String object rather than making a copy and so it is
gently suggested (in the interest of effective memory management) that
extenal clients using this constructor either take pause to consider
the implications or at least take care to provide a String object whose
internal character buffer is not much larger than required to represent
the value.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>data</CODE> - the character sequence representing the Clob value
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if the argument is null</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="length()"><!-- --></A><H3>
length</H3>
<PRE>
public long <B>length</B>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves the number of characters
in the <code>CLOB</code> value
designated by this <code>Clob</code> object.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#length()" title="class or interface in java.sql">length</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>length of the <code>CLOB</code> in characters
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
length of the <code>CLOB</code> value
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getSubString(long, int)"><!-- --></A><H3>
getSubString</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getSubString</B>(long&nbsp;pos,
int&nbsp;length)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves a copy of the specified substring
in the <code>CLOB</code> value
designated by this <code>Clob</code> object.
The substring begins at position
<code>pos</code> and has up to <code>length</code> consecutive
characters.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
The official specification above is ambiguous in that it does not
precisely indicate the policy to be observed when
pos > this.length() - length. One policy would be to retrieve the
characters from pos to this.length(). Another would be to throw
an exception. HSQLDB observes the second policy. <p>
<b>Note</b><p>
Depending java.lang.String implementation, the returned value
may be sharing the underlying (and possibly much larger) character
buffer. This facilitates much faster operation and will save memory
if many transient substrings are to be retrieved during processing, but
it has memory management implications should retrieved substrings be
required to survive for any non-trivial duration. It is left up to the
client to decide how to handle the trade-off (whether to make an isolated
copy of the returned substring or risk that more memory remains allocated
than is absolutely reuired).
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#getSubString(long, int)" title="class or interface in java.sql">getSubString</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the first character of the substring to be extracted.
The first character is at position 1.<DD><CODE>length</CODE> - the number of consecutive characters to be copied
<DT><B>Returns:</B><DD>a <code>String</code> that is the specified substring in
the <code>CLOB</code> value designated by this <code>Clob</code> object
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if pos is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCharacterStream()"><!-- --></A><H3>
getCharacterStream</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> <B>getCharacterStream</B>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
object as a <code>java.io.Reader</code> object (or as a stream of
characters).
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#getCharacterStream()" title="class or interface in java.sql">getCharacterStream</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a <code>java.io.Reader</code> object containing the
<code>CLOB</code> data
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setCharacterStream(long)"><CODE>setCharacterStream(long)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getAsciiStream()"><!-- --></A><H3>
getAsciiStream</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> <B>getAsciiStream</B>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves the <code>CLOB</code> value designated by this <code>Clob</code>
object as an ascii stream.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#getAsciiStream()" title="class or interface in java.sql">getAsciiStream</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>a <code>java.io.InputStream</code> object containing the
<code>CLOB</code> data
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#setAsciiStream(long)"><CODE>setAsciiStream(long)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="position(java.lang.String, long)"><!-- --></A><H3>
position</H3>
<PRE>
public long <B>position</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;searchstr,
long&nbsp;start)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves the character position at which the specified substring
<code>searchstr</code> appears in the SQL <code>CLOB</code> value
represented by this <code>Clob</code> object. The search
begins at position <code>start</code>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#position(java.lang.String, long)" title="class or interface in java.sql">position</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>searchstr</CODE> - the substring for which to search<DD><CODE>start</CODE> - the position at which to begin searching; the first position
is 1
<DT><B>Returns:</B><DD>the position at which the substring appears or -1 if it is not
present; the first position is 1
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if start is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="position(java.sql.Clob, long)"><!-- --></A><H3>
position</H3>
<PRE>
public long <B>position</B>(<A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A>&nbsp;searchstr,
long&nbsp;start)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves the character position at which the specified
<code>Clob</code> object <code>searchstr</code> appears in this
<code>Clob</code> object. The search begins at position
<code>start</code>.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#position(java.sql.Clob, long)" title="class or interface in java.sql">position</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>searchstr</CODE> - the <code>Clob</code> object for which to search<DD><CODE>start</CODE> - the position at which to begin searching; the first
position is 1
<DT><B>Returns:</B><DD>the position at which the <code>Clob</code> object appears
or -1 if it is not present; the first position is 1
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if start is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.2, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setString(long, java.lang.String)"><!-- --></A><H3>
setString</H3>
<PRE>
public int <B>setString</B>(long&nbsp;pos,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Writes the given Java <code>String</code> to the <code>CLOB</code>
value that this <code>Clob</code> object designates at the position
<code>pos</code>. The string will overwrite the existing characters
in the <code>Clob</code> object starting at the position
<code>pos</code>. If the end of the <code>Clob</code> value is reached
while writing the given string, then the length of the <code>Clob</code>
value will be increased to accomodate the extra characters.
<p>
<b>Note:</b> If the value specified for <code>pos</code>
is greater then the length+1 of the <code>CLOB</code> value then the
behavior is undefined. Some JDBC drivers may throw a
<code>SQLException</code> while other drivers may support this
operation.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Starting with HSQLDB 2.0 this feature is supported. <p>
When built under JDK 1.6+ and the Clob instance is constructed as a
result of calling JDBCConnection.createClob(), this operation affects
only the client-side value; it has no effect upon a value stored in the
database because JDBCConnection.createClob() constructs disconnected,
initially empty Clob instances. To propogate the Clob value to a database
in this case, it is required to supply the Clob instance to an updating
or inserting setXXX method of a Prepared or Callable Statement, or to
supply the Clob instance to an updateXXX method of an updateable
ResultSet. <p>
<b>Implementation Notes:</b><p>
No attempt is made to ensure precise thread safety. Instead, volatile
member field and local variable snapshot isolation semantics are
implemented. This is expected to eliminate most issues related
to race conditions, with the possible exception of concurrent
invocation of free(). <p>
In general, however, if an application may perform concurrent
JDBCClob modifications and the integrity of the application depends on
total order Clob modification semantics, then such operations
should be synchronized on an appropriate monitor.<p>
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#setString(long, java.lang.String)" title="class or interface in java.sql">setString</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position at which to start writing to the <code>CLOB</code>
value that this <code>Clob</code> object represents;
The first position is 1<DD><CODE>str</CODE> - the string to be written to the <code>CLOB</code>
value that this <code>Clob</code> designates
<DT><B>Returns:</B><DD>the number of characters written
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if pos is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.4, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setString(long, java.lang.String, int, int)"><!-- --></A><H3>
setString</H3>
<PRE>
public int <B>setString</B>(long&nbsp;pos,
<A HREF="http://java.sun.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;str,
int&nbsp;offset,
int&nbsp;len)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Writes <code>len</code> characters of <code>str</code>, starting
at character <code>offset</code>, to the <code>CLOB</code> value
that this <code>Clob</code> represents. The string will overwrite the existing characters
in the <code>Clob</code> object starting at the position
<code>pos</code>. If the end of the <code>Clob</code> value is reached
while writing the given string, then the length of the <code>Clob</code>
value will be increased to accomodate the extra characters.
<p>
<b>Note:</b> If the value specified for <code>pos</code>
is greater then the length+1 of the <code>CLOB</code> value then the
behavior is undefined. Some JDBC drivers may throw a
<code>SQLException</code> while other drivers may support this
operation.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Starting with HSQLDB 2.0 this feature is supported. <p>
When built under JDK 1.6+ and the Clob instance is constructed as a
result of calling JDBCConnection.createClob(), this operation affects
only the client-side value; it has no effect upon a value stored in a
database because JDBCConnection.createClob() constructs disconnected,
initially empty Clob instances. To propogate the Clob value to a database
in this case, it is required to supply the Clob instance to an updating
or inserting setXXX method of a Prepared or Callable Statement, or to
supply the Clob instance to an updateXXX method of an updateable
ResultSet. <p>
<b>Implementation Notes:</b><p>
If the value specified for <code>pos</code>
is greater than the length of the <code>CLOB</code> value, then
the <code>CLOB</code> value is extended in length to accept the
written characters and the undefined region up to <code>pos</code> is
filled with (char)0. <p>
No attempt is made to ensure precise thread safety. Instead, volatile
member field and local variable snapshot isolation semantics are
implemented. This is expected to eliminate most issues related
to race conditions, with the possible exception of concurrent
invocation of free(). <p>
In general, however, if an application may perform concurrent
JDBCClob modifications and the integrity of the application depends on
total order Clob modification semantics, then such operations
should be synchronized on an appropriate monitor.<p>
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#setString(long, java.lang.String, int, int)" title="class or interface in java.sql">setString</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position at which to start writing to this
<code>CLOB</code> object; The first position is 1<DD><CODE>str</CODE> - the string to be written to the <code>CLOB</code>
value that this <code>Clob</code> object represents<DD><CODE>offset</CODE> - the offset into <code>str</code> to start reading
the characters to be written<DD><CODE>len</CODE> - the number of characters to be written
<DT><B>Returns:</B><DD>the number of characters written
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if pos is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.4, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="setAsciiStream(long)"><!-- --></A><H3>
setAsciiStream</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A> <B>setAsciiStream</B>(long&nbsp;pos)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves a stream to be used to write Ascii characters to the
<code>CLOB</code> value that this <code>Clob</code> object represents,
starting at position <code>pos</code>. Characters written to the stream
will overwrite the existing characters
in the <code>Clob</code> object starting at the position
<code>pos</code>. If the end of the <code>Clob</code> value is reached
while writing characters to the stream, then the length of the <code>Clob</code>
value will be increased to accomodate the extra characters.
<p>
<b>Note:</b> If the value specified for <code>pos</code>
is greater than the length of the <code>CLOB</code> value, then the
behavior is undefined. Some JDBC drivers may throw a
<code>SQLException</code> while other drivers may support this
operation.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Starting with HSQLDB 2.0 this feature is supported. <p>
When built under JDK 1.6+ and the Clob instance is constructed as a
result of calling JDBCConnection.createClob(), this operation affects
only the client-side value; it has no effect upon a value stored in a
database because JDBCConnection.createClob() constructs disconnected,
initially empty Clob instances. To propogate the Clob value to a database
in this case, it is required to supply the Clob instance to an updating
or inserting setXXX method of a Prepared or Callable Statement, or to
supply the Clob instance to an updateXXX method of an updateable
ResultSet. <p>
<b>Implementation Notes:</b><p>
The data written to the stream does not appear in this
Clob until the stream is closed. <p>
When the stream is closed, if the value specified for <code>pos</code>
is greater than the length of the <code>CLOB</code> value, then
the <code>CLOB</code> value is extended in length to accept the
written characters and the undefined region up to <code>pos</code> is
filled with (char)0. <p>
Also, no attempt is made to ensure precise thread safety. Instead,
volatile member field and local variable snapshot isolation semantics
are implemented. This is expected to eliminate most issues related
to race conditions, with the possible exception of concurrent
invocation of free(). <p>
In general, however, if an application may perform concurrent
JDBCClob modifications and the integrity of the application depends on
total order Clob modification semantics, then such operations
should be synchronized on an appropriate monitor.<p>
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#setAsciiStream(long)" title="class or interface in java.sql">setAsciiStream</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position at which to start writing to this
<code>CLOB</code> object; The first position is 1
<DT><B>Returns:</B><DD>the stream to which ASCII encoded characters can be written
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if pos is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.4, HSQLDB 1.7.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getAsciiStream()"><CODE>getAsciiStream()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setCharacterStream(long)"><!-- --></A><H3>
setCharacterStream</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</A> <B>setCharacterStream</B>(long&nbsp;pos)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Retrieves a stream to be used to write a stream of Unicode characters
to the <code>CLOB</code> value that this <code>Clob</code> object
represents, at position <code>pos</code>. Characters written to the stream
will overwrite the existing characters
in the <code>Clob</code> object starting at the position
<code>pos</code>. If the end of the <code>Clob</code> value is reached
while writing characters to the stream, then the length of the <code>Clob</code>
value will be increased to accomodate the extra characters.
<p>
<b>Note:</b> If the value specified for <code>pos</code>
is greater then the length+1 of the <code>CLOB</code> value then the
behavior is undefined. Some JDBC drivers may throw a
<code>SQLException</code> while other drivers may support this
operation.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Starting with HSQLDB 2.0 this feature is supported. <p>
When built under JDK 1.6+ and the Clob instance is constructed as a
result of calling JDBCConnection.createClob(), this operation affects
only the client-side value; it has no effect upon a value stored in a
database because JDBCConnection.createClob() constructs disconnected,
initially empty Clob instances. To propogate the Clob value to a database
in this case, it is required to supply the Clob instance to an updating
or inserting setXXX method of a Prepared or Callable Statement, or to
supply the Clob instance to an updateXXX method of an updateable
ResultSet. <p>
<b>Implementation Notes:</b><p>
The data written to the stream does not appear in this
Clob until the stream is closed. <p>
When the stream is closed, if the value specified for <code>pos</code>
is greater than the length of the <code>CLOB</code> value, then
the <code>CLOB</code> value is extended in length to accept the
written characters and the undefined region up to <code>pos</code> is
filled with (char)0. <p>
Also, no attempt is made to ensure precise thread safety. Instead,
volatile member field and local variable snapshot isolation semantics
are implemented. This is expected to eliminate most issues related
to race conditions, with the possible exception of concurrent
invocation of free(). <p>
In general, however, if an application may perform concurrent
JDBCClob modifications and the integrity of the application depends on
total order Clob modification semantics, then such operations
should be synchronized on an appropriate monitor.<p>
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#setCharacterStream(long)" title="class or interface in java.sql">setCharacterStream</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the position at which to start writing to the
<code>CLOB</code> value; The first position is 1
<DT><B>Returns:</B><DD>a stream to which Unicode encoded characters can be written
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if pos is less than 1
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.4, HSQLDB 1.7.2</DD>
<DT><B>See Also:</B><DD><A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#getCharacterStream()"><CODE>getCharacterStream()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="truncate(long)"><!-- --></A><H3>
truncate</H3>
<PRE>
public void <B>truncate</B>(long&nbsp;len)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Truncates the <code>CLOB</code> value that this <code>Clob</code>
designates to have a length of <code>len</code>
characters.
<p>
<b>Note:</b> If the value specified for <code>len</code>
is greater than the length of the <code>CLOB</code> value, then the
behavior is undefined. Some JDBC drivers may throw a
<code>SQLException</code> while other drivers may support this
operation.
<!-- start release-specific documentation -->
<div class="ReleaseSpecificDocumentation">
<h3>HSQLDB-Specific Information:</h3> <p>
Starting with HSQLDB 2.0 this feature is fully supported. <p>
When built under JDK 1.6+ and the Clob instance is constructed as a
result of calling JDBCConnection.createClob(), this operation affects
only the client-side value; it has no effect upon a value stored in a
database because JDBCConnection.createClob() constructs disconnected,
initially empty Blob instances. To propogate the truncated clob value to
a database in this case, it is required to supply the Clob instance to
an updating or inserting setXXX method of a Prepared or Callable
Statement, or to supply the Blob instance to an updateXXX method of an
updateable ResultSet. <p>
<b>Implementation Notes:</b> <p>
HSQLDB throws an SQLException if the specified <tt>len</tt> is greater
than the value returned by <A HREF="../../../org/hsqldb/jdbc/JDBCClob.html#length()"><CODE>length</CODE></A>. <p>
</div>
<!-- end release-specific documentation -->
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#truncate(long)" title="class or interface in java.sql">truncate</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>len</CODE> - the length, in characters, to which the <code>CLOB</code> value
should be truncated
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if there is an error accessing the
<code>CLOB</code> value or if len is less than 0
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.4, HSQLDB 1.7.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="free()"><!-- --></A><H3>
free</H3>
<PRE>
public void <B>free</B>()
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>This method frees the <code>Clob</code> object and releases the resources the resources
that it holds. The object is invalid once the <code>free</code> method
is called.
<p>
After <code>free</code> has been called, any attempt to invoke a
method other than <code>free</code> will result in a <code>SQLException</code>
being thrown. If <code>free</code> is called multiple times, the subsequent
calls to <code>free</code> are treated as a no-op.
<p>
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#free()" title="class or interface in java.sql">free</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if an error occurs releasing
the Clob's resources
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.6, HSQLDB 2.0</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="getCharacterStream(long, long)"><!-- --></A><H3>
getCharacterStream</H3>
<PRE>
public <A HREF="http://java.sun.com/javase/6/docs/api/java/io/Reader.html?is-external=true" title="class or interface in java.io">Reader</A> <B>getCharacterStream</B>(long&nbsp;pos,
long&nbsp;length)
throws <A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></PRE>
<DL>
<DD>Returns a <code>Reader</code> object that contains a partial <code>Clob</code> value, starting
with the character specified by pos, which is length characters in length.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true#getCharacterStream(long, long)" title="class or interface in java.sql">getCharacterStream</A></CODE> in interface <CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/Clob.html?is-external=true" title="class or interface in java.sql">Clob</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>pos</CODE> - the offset to the first character of the partial value to
be retrieved. The first character in the Clob is at position 1.<DD><CODE>length</CODE> - the length in characters of the partial value to be retrieved.
<DT><B>Returns:</B><DD><code>Reader</code> through which the partial <code>Clob</code> value can be read.
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/javase/6/docs/api/java/sql/SQLException.html?is-external=true" title="class or interface in java.sql">SQLException</A></CODE> - if pos is less than 1 or if pos is greater than the number of
characters in the <code>Clob</code> or if pos + length is greater than the number of
characters in the <code>Clob</code>
<DD><CODE>SQLFeatureNotSupportedException</CODE> - if the JDBC driver does not support
this method<DT><B>Since:</B></DT>
<DD>JDK 1.6, HSQLDB 2.0</DD>
</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JDBCClob.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../org/hsqldb/jdbc/JDBCCallableStatement.html" title="class in org.hsqldb.jdbc"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../org/hsqldb/jdbc/JDBCClobClient.html" title="class in org.hsqldb.jdbc"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../index.html?org/hsqldb/jdbc/JDBCClob.html" target="_top"><B>FRAMES</B></A> &nbsp;
&nbsp;<A HREF="JDBCClob.html" target="_top"><B>NO FRAMES</B></A> &nbsp;
&nbsp;<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;FIELD&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<HR>
<i>Copyright © 2001 - 2009 HSQL Development Group.</i>
</BODY>
</HTML>