- All Superinterfaces:
AutoCloseable
- All Known Subinterfaces:
NClob
- All Known Implementing Classes:
SerialClob
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.
To release resources used by the Clob
object, applications must call either the free()
or the close()
method. Any attempt to invoke a method other than free()
or close()
after the Clob
object has been closed, will result in a SQLException
being thrown.
All methods on the Clob
interface must be fully implemented if the JDBC driver supports the data type.
- Since:
- 1.2
Methods
- +Only in: JDBC 4.5; not in: JDBC 4.4.public default void close() throws java.sql.SQLExceptionNot in JDBC 4.4; only in JDBC 4.5
close
Closes and releases the resources held by thisClobobject.If the
Clobobject is already closed, then invoking this method has no effect.- Specified by:
closein interfaceAutoCloseable- Implementation Requirements:
- The default implementation calls the
free()method. - Throws:
SQLException- if an error occurs releasing the Clob's resourcesSQLFeatureNotSupportedException- if the JDBC driver does not support this method- Since:
- 26
- See Also:
- ≠public abstract void free() throws java.sql.SQLExceptionComparing JDBC 4.4 and JDBC 4.5
free
This method Closes and releases the resources that the held by thisClobobject holds. The object is invalid once thefreemethod is called.After
freehas been called, any attempt to invoke a method other thanfreewill result in aSQLExceptionbeing thrown. Iffreeis called multiple times, the subsequent calls tofreeare treated as a no-op If theClobobject is already closed, then invoking this method has no effect.- Throws:
SQLException- if an error occurs releasing the Clob's resourcesSQLFeatureNotSupportedException- if the JDBC driver does not support this method- Since:
- 1.6
- See Also:
- =public abstract java.io.InputStream getAsciiStream() throws java.sql.SQLException
- =public abstract java.io.Reader getCharacterStream() throws java.sql.SQLException
- =public abstract java.io.Reader getCharacterStream(long arg0, long arg1) throws java.sql.SQLException
- =public abstract java.lang.String getSubString(long arg0, int arg1) throws java.sql.SQLException
- =public abstract long length() throws java.sql.SQLException
- =public abstract long position(java.lang.String arg0, long arg1) throws java.sql.SQLException
- =public abstract long position(java.sql.Clob arg0, long arg1) throws java.sql.SQLException
- =public abstract java.io.OutputStream setAsciiStream(long arg0) throws java.sql.SQLException
- =public abstract java.io.Writer setCharacterStream(long arg0) throws java.sql.SQLException
- =public abstract int setString(long arg0, java.lang.String arg1) throws java.sql.SQLException
- =public abstract int setString(long arg0, java.lang.String arg1, int arg2, int arg3) throws java.sql.SQLException
- =public abstract void truncate(long arg0) throws java.sql.SQLException
Summary
| Elements | Comments | Descriptions | Total | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed | ||
| Clob | 2 | 14 | 16 | |||||||
| close() | 1 | 1 | 2 | |||||||
| free() | 5 | 2 | 3 | 10 | ||||||
| Total | 1 | 2 | 20 | 2 | 3 | 28 | ||||