Interface NClob
- All Superinterfaces:
AutoCloseable, Clob
public interface NClob extends Clob
NCLOB type. An SQL NCLOB is a built-in type that stores a Character Large Object using the National Character Set as a column value in a row of a database table. The NClob interface extends the Clob interface which provides methods for getting the length of an SQL NCLOB value, for materializing a NCLOB value on the client, and for searching for a substring or NCLOB object within a NCLOB value. A NClob object, just like a Clob object, is valid for the duration of the transaction in which it was created. Methods in the interfaces ResultSet, CallableStatement, and PreparedStatement, such as getNClob and setNClob allow a programmer to access an SQL NCLOB value. In addition, this interface has methods for updating a NCLOB value.
To release resources used by the NClob object, applications must call either the Clob.free() or the Clob.close() method. Any attempt to invoke a method other than Clob.free() or Clob.close() after the NClob object has been closed, will result in a SQLException being thrown.
All methods on the NClob interface must be fully implemented if the JDBC driver supports the data type.
- Since:
- 1.6
Method Summary
Methods declared in interface Clob
close, free, getAsciiStream, getCharacterStream, getCharacterStream, getSubString, length, position, position, setAsciiStream, setCharacterStream, setString, setString, truncate | Modifier and Type | Method | Description |
|---|---|---|
default void |
close() |
Closes and releases the resources held by this Clob object. |
void |
free() |
Closes and releases the resources held by this Clob object. |
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 |
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 |
Retrieves a copy of the specified substring in the CLOB value designated by this Clob object. |
long |
length() |
Retrieves the number of characters in the CLOB value designated by this Clob object. |
long |
position |
Retrieves the character position at which the specified substring searchstr appears in the SQL CLOB value represented by this Clob object. |
long |
position |
Retrieves the character position at which the specified Clob object searchstr appears in this Clob object. |
OutputStream |
setAsciiStream |
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 |
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 |
Writes the given Java String to the CLOB value that this Clob object designates at the position pos. |
int |
setString |
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents. |
void |
truncate |
Truncates the CLOB value that this Clob designates to have a length of len characters. |
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.