public class CLOB extends DatumWithConnection implements oracle.jdbc.internal.OracleClob, oracle.jdbc.internal.OracleConcreteProxy
Obtaining java.sql.Clob from ResultSet
java.sql.Clob clob = resultSet.getClob(...);
Creating a temporary Clob should use Connection.createClob()
java.sql.Clob clob = connection.createClob();Clob, OracleClob, Connection.createClob(), Serialized Form| Modifier and Type | Field and Description |
|---|---|
static int |
DURATION_CALL
Deprecated.
|
static int |
DURATION_INVALID
Deprecated.
|
static int |
DURATION_SESSION
Deprecated.
|
static int |
MAX_CHUNK_SIZE
Deprecated.
|
static int |
MODE_READONLY
Deprecated.
|
static int |
MODE_READWRITE
Deprecated.
|
static int |
OLD_WRONG_DURATION_CALL
Deprecated.
|
static int |
OLD_WRONG_DURATION_SESSION
Deprecated.
|
protected oracle.jdbc.driver.OracleClob |
target
Deprecated.
|
targetDatumWithConnectionojiOracleDatumWithConnection, targetDatum| Modifier | Constructor and Description |
|---|---|
protected |
CLOB()
Deprecated.
|
protected |
CLOB(oracle.jdbc.driver.OracleClob c)
Deprecated.
Call from empty lob static method
|
|
CLOB(OracleConnection conn, byte[] lob_descriptor, short csform)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReadBasicLobDataInLocator()
Deprecated.
Can the lob data be read directly from the locator?
|
void |
close()
Deprecated.
Close a previously opened CLOB.
|
static CLOB |
createTemporary(Connection conn, boolean cache, int _duration)
Deprecated.
Create a temporary clob.
|
static CLOB |
createTemporary(Connection conn, boolean cache, int _duration, short form_of_use)
Deprecated.
Create a temporary clob or nclob.
|
static CLOB |
empty_lob()
Deprecated.
use getEmptyCLOB instead
|
void |
free()
Deprecated.
Free the resources the clob holds.
|
void |
freeTemporary()
Deprecated.
Free the contents and the locator of the temporary clob.
|
static void |
freeTemporary(CLOB temp_lob)
Deprecated.
Free the contents and the locator of the temporary clob.
|
OutputStream |
getAsciiOutputStream()
Deprecated.
This method is deprecated. Use setAsciiStream( 1L );
|
OutputStream |
getAsciiOutputStream(long pos)
Deprecated.
This method is deprecated. Use setAsciiStream.
|
InputStream |
getAsciiStream()
Deprecated.
Implements the Clob interface method.
|
InputStream |
getAsciiStream(boolean isInternal)
Deprecated.
Implements the Clob interface method.
|
InputStream |
getAsciiStream(long pos)
Deprecated.
Read from the CLOB as a stream at the requested position.
|
int |
getBufferSize()
Deprecated.
Oracle extension.
|
Writer |
getCharacterOutputStream()
Deprecated.
This method is deprecated. Use setCharacterStream( 1L ).
|
Writer |
getCharacterOutputStream(long pos)
Deprecated.
This method is deprecated. Use setCharacterStream.
|
Reader |
getCharacterStream()
Deprecated.
Implements the Clob interface method.
|
Reader |
getCharacterStream(long pos)
Deprecated.
Read from the CLOB as a stream at the requested position.
|
Reader |
getCharacterStream(long pos, long length)
Deprecated.
Return a character stream beginning at the specified position and ofthe specified length.
|
int |
getChars(long pos, int length, char[] buffer)
Deprecated.
Oracle extension.
|
int |
getChunkSize()
Deprecated.
Oracle extension.
|
short |
getDuration()
Deprecated.
return the duration of a temporary LOB
|
static short |
getDuration(CLOB lob)
Deprecated.
return the duration of a temporary LOB
|
static CLOB |
getEmptyCLOB()
Deprecated.
Return a empty lob.
|
static short |
getFormOfUseFromLocator(byte[] lob_descriptor)
Deprecated.
|
Connection |
getJavaSqlConnection()
Deprecated.
Oracle extension Return the java.sql.Connection associated with the receiver.
|
int |
getPrefetchedDataSize()
Deprecated.
|
String |
getSubString(long pos, int length)
Deprecated.
Implements the Clob interface method.
|
oracle.jdbc.driver.OracleClob |
getTarget()
Deprecated.
|
boolean |
isConvertibleTo(Class jClass)
Deprecated.
Test whether this data object can be converted to the specified Java data type.
|
boolean |
isEmptyLob()
Deprecated.
Return true if this is a empty lob.
|
boolean |
isNCLOB()
Deprecated.
|
boolean |
isOpen()
Deprecated.
Check whether the CLOB is opened.
|
boolean |
isSecureFile()
Deprecated.
Returns
true if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1). |
boolean |
isTemporary()
Deprecated.
Return true if the lob locator points to a temporary clob.
|
static boolean |
isTemporary(CLOB lob)
Deprecated.
Return true if the lob locator points to a temporary clob.
|
long |
length()
Deprecated.
Implements the Clob interface method.
|
void |
open(LargeObjectAccessMode mode)
Deprecated.
Public method using enum instead of int
|
long |
position(Clob searchstr, long start)
Deprecated.
Implements the Clob interface method.
|
long |
position(String searchstr, long start)
Deprecated.
Implements the Clob interface method.
|
int |
putChars(long pos, char[] chars)
Deprecated.
Oracle extension.
|
int |
putChars(long pos, char[] chars, int length)
Deprecated.
Oracle extension.
|
int |
putChars(long pos, char[] chars, int offset, int length)
Deprecated.
Oracle extension.
|
int |
putString(long pos, String str)
Deprecated.
This method is deprecated -- use setString.
|
OutputStream |
setAsciiStream(long pos)
Deprecated.
JDBC 3.0 Retrieves a stream to be used to write Ascii characters to the
CLOB value that this Clob object represents, starting at position pos. |
void |
setBytes(byte[] locator)
Deprecated.
Sets datum value using a byte array.
|
Writer |
setCharacterStream(long pos)
Deprecated.
JDBC 3.0 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(long pos, String str)
Deprecated.
JDBC 3.0 Writes the given Java
String to the CLOB value that this Clob object designates at the position pos. |
int |
setString(long pos, String str, int offset, int len)
Deprecated.
JDBC 3.0 Writes
len characters of str, starting at character offset, to the CLOB value that this Clob represents. |
String |
stringValue()
Deprecated.
Convert to a String representation of the datum object
|
Object |
toJdbc()
Deprecated.
Convert this data object into its default Java object type.
|
SQLXML |
toSQLXML()
Deprecated.
Returns an object which impements java.sql.SQLXML with content take from this Clob.
|
SQLXML |
toSQLXML(String schemaURL)
Deprecated.
Returns an object which impements java.sql.SQLXML with content taken from this Clob.
|
void |
trim(long newlen)
Deprecated.
This method is deprecated. Use truncate().
|
void |
truncate(long len)
Deprecated.
JDBC 3.0 Truncates the
CLOB value that this Clob designates to have a length of len characters. |
assertNotNull, assertNotNull, getConnection, getConnectionDuringExceptionHandling, getOracleConnectionbigDecimalValue, booleanValue, bytesEqual, bytesHashCode, byteValue, compareBytes, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, isNull, longValue, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue, toClassclone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValuepublic static final int MAX_CHUNK_SIZE
public static final int DURATION_INVALID
public static final int DURATION_SESSION
public static final int DURATION_CALL
public static final int OLD_WRONG_DURATION_SESSION
public static final int OLD_WRONG_DURATION_CALL
public static final int MODE_READONLY
public static final int MODE_READWRITE
protected oracle.jdbc.driver.OracleClob target
protected CLOB()
protected CLOB(oracle.jdbc.driver.OracleClob c)
public CLOB(OracleConnection conn, byte[] lob_descriptor, short csform) throws SQLException
SQLExceptionpublic oracle.jdbc.driver.OracleClob getTarget()
public static final short getFormOfUseFromLocator(byte[] lob_descriptor)
public boolean isNCLOB()
public long length()
throws SQLException
CLOB value designated by this Clob object.length in interface ClobCLOB in charactersSQLException - if there is an error accessing the length of the CLOBpublic String getSubString(long pos, int length) throws SQLException
CLOB value designated by this Clob object. The substring begins at position pos and has up to length consecutive characters.getSubString in interface Clobpos - the first character of the substring to be extracted. The first character is at position 1.length - the number of consecutive characters to be copiedString that is the specified substring in the CLOB value designated by this Clob object. If the pos argument is larger than the length of the data the result is an empty String. If the pos argument is less than the length of the data, but the sum of pos argument and the length is greater than the length of the data, the result will be smaller than the length requested.SQLException - if there is an error accessing the CLOBpublic Reader getCharacterStream() throws SQLException
Clob contents as a Unicode stream.getCharacterStream in interface ClobCLOB dataSQLException - if there is an error accessing the CLOBpublic InputStream getAsciiStream() throws SQLException
CLOB value designated by this Clob object as a stream of Ascii bytes.getAsciiStream in interface ClobCLOB dataSQLException - if there is an error accessing the CLOB valuepublic InputStream getAsciiStream(boolean isInternal) throws SQLException
CLOB value designated by this Clob object as a stream of Ascii bytes.CLOB dataSQLException - if there is an error accessing the CLOB valuepublic long position(String searchstr, long start) throws SQLException
position in interface Clobsearchstr - is the substring to search for.start - is the position at which to begin searching.SQLExceptionpublic long position(Clob searchstr, long start) throws SQLException
position in interface Clobsearchstr - is the substring to search for.start - is the position at which to begin searching.SQLExceptionpublic int getChars(long pos,
int length,
char[] buffer)
throws SQLException
buffer - is the buffer into whcih the characters are read.pos - is the first character of the substring to be extracted.length - is the number of consecutive character to be copied.SQLExceptionpublic Writer getCharacterOutputStream() throws SQLException
SQLExceptionpublic OutputStream getAsciiOutputStream() throws SQLException
SQLExceptionpublic int putChars(long pos,
char[] chars)
throws SQLException
pos - is the position to write characters.chars - is the buffer of characters to be written.SQLExceptionpublic int putChars(long pos,
char[] chars,
int length)
throws SQLException
pos - is the position to write characters.chars - is the buffer of characters to be written.length - is the length to writeSQLExceptionpublic int putChars(long pos,
char[] chars,
int offset,
int length)
throws SQLException
pos - is the position to write characters.chars - is the buffer of characters to be written.offset - is the position in the buffer from which to beginlength - is the length to writeSQLExceptionpublic int putString(long pos,
String str)
throws SQLException
SQLExceptionpublic int getChunkSize()
throws SQLException
SQLExceptionpublic int getBufferSize()
throws SQLException
SQLExceptionpublic static CLOB empty_lob() throws SQLException
SQLExceptionpublic static CLOB getEmptyCLOB() throws SQLException
SQLExceptionpublic boolean isEmptyLob()
throws SQLException
isEmptyLob in interface OracleClobSQLExceptionempty_lobpublic boolean isSecureFile()
throws SQLException
true if this is a SecureFile (LOBs with the STORE AS SECUREFILE option, which were introduced in Oracle Database 11g Release 1).isSecureFile in interface OracleClobtrue if this is a SecureFile and false otherwise.SQLExceptionpublic OutputStream getAsciiOutputStream(long pos) throws SQLException
pos - is the position data to be put.SQLExceptionpublic Writer getCharacterOutputStream(long pos) throws SQLException
pos - is the position data to be put.SQLExceptionpublic InputStream getAsciiStream(long pos) throws SQLException
pos - is the position data to be put.SQLExceptionpublic Reader getCharacterStream(long pos) throws SQLException
pos - is the position data to be put.SQLExceptionpublic void trim(long newlen)
throws SQLException
newlen - the new length of the CLOB.SQLExceptionpublic static CLOB createTemporary(Connection conn, boolean cache, int _duration) throws SQLException
cache - Specifies if LOB should be read into buffer cache or not._duration - The duration of the temporary LOB. The following are valid values: DURATION_SESSION, DURATION_CALL.SQLExceptionpublic static CLOB createTemporary(Connection conn, boolean cache, int _duration, short form_of_use) throws SQLException
cache - Specifies if LOB should be read into buffer cache or not._duration - The duration of the temporary LOB. The following are valid values: DURATION_SESSION, DURATION_CALL.form_of_use - Valid values are FORM_CHAR and FORM_NCHARSQLExceptionpublic static void freeTemporary(CLOB temp_lob) throws SQLException
temp_lob - A temporary clob to be freeed.SQLException - if temp_lob is a permanent lob or temp_lob has already been freed.public static boolean isTemporary(CLOB lob) throws SQLException
lob - the clob to test.SQLExceptionpublic static short getDuration(CLOB lob) throws SQLException
SQLExceptionpublic void freeTemporary()
throws SQLException
freeTemporary in interface oracle.jdbc.internal.OracleLargeObjectSQLException - if self is a permanent lob or self has already been freed.public boolean isTemporary()
throws SQLException
isTemporary in interface oracle.jdbc.internal.OracleLargeObjectisTemporary in interface OracleClobSQLExceptionpublic short getDuration()
throws SQLException
getDuration in interface oracle.jdbc.internal.OracleLargeObjectSQLExceptionpublic void open(LargeObjectAccessMode mode) throws SQLException
open in interface OracleClobSQLExceptionpublic void close()
throws SQLException
close in interface OracleClobSQLExceptionpublic boolean isOpen()
throws SQLException
isOpen in interface OracleClobSQLExceptionpublic int setString(long pos,
String str)
throws SQLException
String to the CLOB value that this Clob object designates at the position pos.setString in interface Clobpos - the position at which to start writing to the CLOB value that this Clob object representsstr - the string to be written to the CLOB value that this Clob designatesSQLException - if there is an error accessing the CLOB valuepublic int setString(long pos,
String str,
int offset,
int len)
throws SQLException
len characters of str, starting at character offset, to the CLOB value that this Clob represents.setString in interface Clobpos - the position at which to start writing to this CLOB objectstr - the string to be written to the CLOB value that this Clob object representsoffset - the offset into str to start reading the characters to be writtenlen - the number of characters to be writtenSQLException - if there is an error accessing the CLOB valuepublic OutputStream setAsciiStream(long pos) throws SQLException
CLOB value that this Clob object represents, starting at position pos.setAsciiStream in interface Clobpos - the position at which to start writing to this CLOB objectSQLException - if there is an error accessing the CLOB valuepublic Writer setCharacterStream(long pos) throws SQLException
CLOB value that this Clob object represents, at position pos.setCharacterStream in interface Clobpos - the position at which to start writing to the CLOB valueSQLException - if there is an error accessing the CLOB valuepublic void truncate(long len)
throws SQLException
CLOB value that this Clob designates to have a length of len characters.truncate in interface Cloblen - the length, in bytes, to which the CLOB value should be truncatedSQLException - if there is an error accessing the CLOB valuepublic Object toJdbc() throws SQLException
toJdbc in interface oracle.jdbc.internal.OracleDatumWithConnectiontoJdbc in class DatumSQLException - if any of the lower layer code throws an exception.public boolean isConvertibleTo(Class jClass)
isConvertibleTo in interface oracle.jdbc.internal.OracleDatumWithConnectionisConvertibleTo in class DatumjClass - specifies the Java data type to test against.public String stringValue() throws SQLException
stringValue in interface oracle.jdbc.internal.OracleDatumWithConnectionstringValue in class DatumSQLException, - if no String representation existsSQLExceptionpublic Connection getJavaSqlConnection() throws SQLException
DatumWithConnectiongetJavaSqlConnection in interface oracle.jdbc.internal.OracleDatumWithConnectiongetJavaSqlConnection in class DatumWithConnectionSQLException - if an error occurspublic final int getPrefetchedDataSize()
public boolean canReadBasicLobDataInLocator()
throws SQLException
SQLExceptionpublic void free()
throws SQLException
free in interface ClobSQLExceptionpublic Reader getCharacterStream(long pos, long length) throws SQLException
getCharacterStream in interface Clobpos - start positionlength - number of characters in the resultSQLException - - if pos is less than 1 or if pos is greater than the number of characters in the Clob or if pos + length is greater than the number of characters in the Clob or if an error occurspublic void setBytes(byte[] locator)
Datumpublic SQLXML toSQLXML() throws SQLException
toSQLXML in interface OracleClobSQLExceptionpublic SQLXML toSQLXML(String schemaURL) throws SQLException
toSQLXML in interface OracleClobSQLException