|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.sql.Datum oracle.sql.DatumWithConnection oracle.sql.CLOB
public class CLOB
This class implements java.sql.Clob interface in JDBC.2.0.
Field Summary | |
---|---|
static java.lang.String |
BUILD_DATE
|
static int |
DURATION_CALL
|
static int |
DURATION_SESSION
|
static int |
MAX_CHUNK_SIZE
|
static int |
MODE_READONLY
|
static int |
MODE_READWRITE
|
static boolean |
TRACE
|
Constructor Summary | |
---|---|
CLOB(OracleConnection conn,
byte[] lob_descriptor,
short csform)
|
Method Summary | |
---|---|
void |
close()
Close a previously opened CLOB. |
static CLOB |
createTemporary(java.sql.Connection conn,
boolean cache,
int _duration)
Create a temporary clob. |
static CLOB |
createTemporary(java.sql.Connection conn,
boolean cache,
int _duration,
short form_of_use)
Create a temporary clob or nclob. |
static CLOB |
empty_lob()
Deprecated. use getEmptyCLOB instead |
void |
freeTemporary()
Free the contents and the locator of the temporary clob. |
static void |
freeTemporary(CLOB temp_lob)
Free the contents and the locator of the temporary clob. |
java.io.OutputStream |
getAsciiOutputStream()
Deprecated. This method is deprecated. Use setAsciiStream( 1L ); |
java.io.OutputStream |
getAsciiOutputStream(long pos)
Deprecated. This method is deprecated. Use setAsciiStream. |
java.io.InputStream |
getAsciiStream()
Implements the Clob interface method. |
java.io.InputStream |
getAsciiStream(long pos)
Read from the CLOB as a stream at the requested position. |
int |
getBufferSize()
Oracle extension. |
java.io.Writer |
getCharacterOutputStream()
Deprecated. This method is deprecated. Use setCharacterStream( 1L ). |
java.io.Writer |
getCharacterOutputStream(long pos)
Deprecated. This method is deprecated. Use setCharacterStream. |
java.io.Reader |
getCharacterStream()
Implements the Clob interface method. |
java.io.Reader |
getCharacterStream(long pos)
Read from the CLOB as a stream at the requested position. |
int |
getChars(long pos,
int length,
char[] buffer)
Oracle extension. |
int |
getChunkSize()
Oracle extension. |
static CLOB |
getEmptyCLOB()
Return a empty lob. |
java.sql.Connection |
getJavaSqlConnection()
Oracle extension Return the java.sql.Connection associated with the receiver. |
int |
getPrefetchedDataSize()
|
java.lang.String |
getSubString(long pos,
int length)
Implements the Clob interface method. |
boolean |
isConvertibleTo(java.lang.Class jClass)
Test whether this data object can be converted to the specified Java data type. |
boolean |
isEmptyLob()
Return true if this is a empty lob. |
boolean |
isNCLOB()
|
boolean |
isOpen()
Check whether the CLOB is opened. |
boolean |
isSecureFile()
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()
Return true if the lob locator points to a temporary clob. |
static boolean |
isTemporary(CLOB lob)
Return true if the lob locator points to a temporary clob. |
long |
length()
Implements the Clob interface method. |
void |
open(int mode)
Open a CLOB in the indicated mode. |
void |
open(LargeObjectAccessMode mode)
Public method using enum instead of int |
long |
position(java.sql.Clob searchstr,
long start)
Implements the Clob interface method. |
long |
position(java.lang.String searchstr,
long start)
Implements the Clob interface method. |
int |
putChars(long pos,
char[] chars)
Oracle extension. |
int |
putChars(long pos,
char[] chars,
int length)
Oracle extension. |
int |
putChars(long pos,
char[] chars,
int offset,
int length)
Oracle extension. |
int |
putString(long pos,
java.lang.String str)
Deprecated. This method is deprecated -- use setString. |
java.io.OutputStream |
setAsciiStream(long pos)
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 . |
java.io.Writer |
setCharacterStream(long pos)
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,
java.lang.String str)
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,
java.lang.String str,
int offset,
int len)
JDBC 3.0 Writes len characters of str , starting
at character offset , to the CLOB value
that this Clob represents. |
java.lang.String |
stringValue()
Convert to a String representation of the datum object |
java.lang.Object |
toJdbc()
Convert this data object into its default Java object type. |
void |
trim(long newlen)
Deprecated. This method is deprecated. Use truncate(). |
void |
truncate(long len)
JDBC 3.0 Truncates the CLOB value that this Clob
designates to have a length of len
characters. |
Methods inherited from class oracle.sql.DatumWithConnection |
---|
assertNotNull, assertNotNull, getConnection, getOracleConnection |
Methods inherited from class oracle.sql.Datum |
---|
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, equals, floatValue, getBytes, getLength, getStream, intValue, longValue, setBytes, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.jdbc.internal.OracleDatumWithConnection |
---|
bigDecimalValue, booleanValue, byteValue, dateValue, doubleValue, floatValue, getBytes, getConnection, getInternalConnection, getLength, getOracleConnection, getStream, intValue, longValue, setBytes, setPhysicalConnectionOf, setShareBytes, shareBytes, stringValue, timestampValue, timestampValue, timeValue, timeValue |
Field Detail |
---|
public static final int MAX_CHUNK_SIZE
public static final int DURATION_SESSION
public static final int DURATION_CALL
public static final int MODE_READONLY
public static final int MODE_READWRITE
public static final java.lang.String BUILD_DATE
public static final boolean TRACE
Constructor Detail |
---|
public CLOB(OracleConnection conn, byte[] lob_descriptor, short csform) throws java.sql.SQLException
java.sql.SQLException
Method Detail |
---|
public boolean isNCLOB()
public long length() throws java.sql.SQLException
CLOB
value
designated by this Clob
object.
length
in interface java.sql.Clob
CLOB
in characters
java.sql.SQLException
- if there is an error accessing the
length of the CLOB
public java.lang.String getSubString(long pos, int length) throws java.sql.SQLException
CLOB
value
designated by this Clob
object.
The substring begins at position
pos
and has up to length
consecutive
characters.
getSubString
in interface java.sql.Clob
pos
- the first character of the substring to be extracted.
The first character is at position 1.length
- the number of consecutive characters to be copied
String
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.
java.sql.SQLException
- if there is an error accessing the
CLOB
public java.io.Reader getCharacterStream() throws java.sql.SQLException
Clob
contents as a Unicode stream.
getCharacterStream
in interface java.sql.Clob
CLOB
data
java.sql.SQLException
- if there is an error accessing the
CLOB
public java.io.InputStream getAsciiStream() throws java.sql.SQLException
CLOB
value designated by this Clob
object as a stream of Ascii bytes.
getAsciiStream
in interface java.sql.Clob
CLOB
data
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic long position(java.lang.String searchstr, long start) throws java.sql.SQLException
position
in interface java.sql.Clob
searchstr
- is the substring to search for.start
- is the position at which to begin searching.
java.sql.SQLException
public long position(java.sql.Clob searchstr, long start) throws java.sql.SQLException
position
in interface java.sql.Clob
searchstr
- is the substring to search for.start
- is the position at which to begin searching.
java.sql.SQLException
public int getChars(long pos, int length, char[] buffer) throws java.sql.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.
java.sql.SQLException
public java.io.Writer getCharacterOutputStream() throws java.sql.SQLException
java.sql.SQLException
public java.io.OutputStream getAsciiOutputStream() throws java.sql.SQLException
java.sql.SQLException
public int putChars(long pos, char[] chars) throws java.sql.SQLException
pos
- is the position to write characters.chars
- is the buffer of characters to be written.
java.sql.SQLException
public int putChars(long pos, char[] chars, int length) throws java.sql.SQLException
pos
- is the position to write characters.chars
- is the buffer of characters to be written.length
- is the length to write
java.sql.SQLException
public int putChars(long pos, char[] chars, int offset, int length) throws java.sql.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 write
java.sql.SQLException
public int putString(long pos, java.lang.String str) throws java.sql.SQLException
java.sql.SQLException
public int getChunkSize() throws java.sql.SQLException
java.sql.SQLException
public int getBufferSize() throws java.sql.SQLException
java.sql.SQLException
public static CLOB empty_lob() throws java.sql.SQLException
java.sql.SQLException
public static CLOB getEmptyCLOB() throws java.sql.SQLException
java.sql.SQLException
public boolean isEmptyLob() throws java.sql.SQLException
isEmptyLob
in interface OracleClob
java.sql.SQLException
empty_lob
public boolean isSecureFile() throws java.sql.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 OracleClob
true
if this is a SecureFile and false
otherwise.
java.sql.SQLException
public java.io.OutputStream getAsciiOutputStream(long pos) throws java.sql.SQLException
pos
- is the position data to be put.
java.sql.SQLException
public java.io.Writer getCharacterOutputStream(long pos) throws java.sql.SQLException
pos
- is the position data to be put.
java.sql.SQLException
public java.io.InputStream getAsciiStream(long pos) throws java.sql.SQLException
pos
- is the position data to be put.
java.sql.SQLException
public java.io.Reader getCharacterStream(long pos) throws java.sql.SQLException
pos
- is the position data to be put.
java.sql.SQLException
public void trim(long newlen) throws java.sql.SQLException
newlen
- the new length of the CLOB.
java.sql.SQLException
public static CLOB createTemporary(java.sql.Connection conn, boolean cache, int _duration) throws java.sql.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.
java.sql.SQLException
public static CLOB createTemporary(java.sql.Connection conn, boolean cache, int _duration, short form_of_use) throws java.sql.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_NCHAR
java.sql.SQLException
public static void freeTemporary(CLOB temp_lob) throws java.sql.SQLException
temp_lob
- A temporary clob to be freeed.
java.sql.SQLException
- if temp_lob is a permanent lob or temp_lob has
already been freed.public static boolean isTemporary(CLOB lob) throws java.sql.SQLException
lob
- the clob to test.
java.sql.SQLException
public void freeTemporary() throws java.sql.SQLException
java.sql.SQLException
- if self is a permanent lob or self has
already been freed.public boolean isTemporary() throws java.sql.SQLException
isTemporary
in interface OracleClob
java.sql.SQLException
public void open(LargeObjectAccessMode mode) throws java.sql.SQLException
open
in interface OracleClob
java.sql.SQLException
public void open(int mode) throws java.sql.SQLException
java.sql.SQLException
public void close() throws java.sql.SQLException
close
in interface OracleClob
java.sql.SQLException
public boolean isOpen() throws java.sql.SQLException
isOpen
in interface OracleClob
java.sql.SQLException
public int setString(long pos, java.lang.String str) throws java.sql.SQLException
String
to the CLOB
value that this Clob
object designates at the position
pos
.
setString
in interface java.sql.Clob
pos
- 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
designates
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLException
len
characters of str
, starting
at character offset
, to the CLOB
value
that this Clob
represents.
setString
in interface java.sql.Clob
pos
- 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 written
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
CLOB
value that this Clob
object represents,
starting at position pos
.
setAsciiStream
in interface java.sql.Clob
pos
- the position at which to start writing to this
CLOB
object
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic java.io.Writer setCharacterStream(long pos) throws java.sql.SQLException
CLOB
value that this Clob
object
represents, at position pos
.
setCharacterStream
in interface java.sql.Clob
pos
- the position at which to start writing to the
CLOB
value
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic void truncate(long len) throws java.sql.SQLException
CLOB
value that this Clob
designates to have a length of len
characters.
truncate
in interface java.sql.Clob
len
- the length, in bytes, to which the CLOB
value
should be truncated
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic java.lang.Object toJdbc() throws java.sql.SQLException
toJdbc
in interface oracle.jdbc.internal.OracleDatumWithConnection
toJdbc
in class Datum
java.sql.SQLException
- if any of the lower layer code throws an exception.public boolean isConvertibleTo(java.lang.Class jClass)
isConvertibleTo
in interface oracle.jdbc.internal.OracleDatumWithConnection
isConvertibleTo
in class Datum
jClass
- specifies the Java data type to test against.
public java.lang.String stringValue() throws java.sql.SQLException
stringValue
in interface oracle.jdbc.internal.OracleDatumWithConnection
stringValue
in class Datum
SQLException,
- if no String representation exists
java.sql.SQLException
public java.sql.Connection getJavaSqlConnection() throws java.sql.SQLException
DatumWithConnection
getJavaSqlConnection
in interface oracle.jdbc.internal.OracleDatumWithConnection
getJavaSqlConnection
in class DatumWithConnection
java.sql.SQLException
- if an error occurspublic final int getPrefetchedDataSize()
|
Oracle JDBC API Reference 11g Release 2 ("11.2.0.3.0") |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |