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 {@link java.sql.ResultSet}, {@link java.sql.CallableStatement}, and {@link java.sql.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.
All methods on the Clob
interface must be fully implemented if the JDBC driver supports the data type.
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.
Starting with 2.0, the HSQLDB driver fully supports both local and remote SQL CLOB data implementations, meaning that an HSQLDB Clob object may contain a logical pointer to remote SQL CLOB data (see {@link JDBCClobClient JDBCClobClient}) 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|