|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.runtime.type.sql.ClobImpl
public final class ClobImpl
The representation (mapping) in the Java TM
programming language of an SQL CLOB
value. 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
Clob
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 is was created.
Methods in the interfaces DriverResultSet
,CallableStatement
,
and PreparedStatement
, such as getClob
and
setClob
allow a programmer to access an SQL CLOB
value. 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 determining
the position of a pattern of bytes within a CLOB
value. In
addition, this interface has methods for updating a CLOB
value.
Method Summary | |
---|---|
void |
free()
|
InputStream |
getAsciiStream()
Retrieves the CLOB value designated by this
Clob instance as a stream. |
Reader |
getCharacterStream()
Materializes the CLOB value designated by this object
as a stream of Unicode character. |
Reader |
getCharacterStream(long pos,
long len)
|
String |
getSubString(long pos,
int length)
Returns a copy of the portion of the CLOB value represented
by this CLOB object that starts at position position
and has ip to length consecutive characters. |
long |
length()
Returns the size of the CLOB value designated by this
Clob object |
long |
position(Clob searchstr,
long start)
Retrieves the character position at which the specified Clob
object searchstr begins within the CLOB value
that this Clob object represents. |
long |
position(String searchstr,
long start)
Retrieves the character position at which the specified string searchstr begins within the CLOB value that
this Clob object represents. |
OutputStream |
setAsciiStream(long pos)
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(long pos)
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)
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)
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents. |
static Clob |
toClob(Object value)
cast given value to a clob |
static Clob |
toClob(String value)
|
String |
toString()
|
void |
truncate(long len)
Truncates the CLOB value that this Clob designates to have a length of len characters. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static Clob toClob(Object value) throws PageException
value
-
PageException
public static Clob toClob(String value)
public long length() throws SQLException
CLOB
value designated by this
Clob
object
length
in interface Clob
CLOB
value that this clob
represents
SQLException
- if there is an error accessing the length of the
CLOB
public InputStream getAsciiStream() throws SQLException
CLOB
value designated by this
Clob
instance as a stream.
getAsciiStream
in interface Clob
CLOB
data
SQLException
- if there is an error accessing the
CLOB
valuepublic Reader getCharacterStream() throws SQLException
CLOB
value designated by this object
as a stream of Unicode character.
- Specified by:
getCharacterStream
in interface Clob
- Returns:
- A reader object with all the data in the
CLOB
value
designated by this clob object as unicode characters.
- Throws:
SQLException
- if there is an error accessing the
CLOB
value
public Reader getCharacterStream(long pos, long len)
getCharacterStream
in interface Clob
public String getSubString(long pos, int length) throws SQLException
CLOB
value represented
by this CLOB
object that starts at position position
and has ip to length consecutive characters.
getSubString
in interface Clob
pos
- the position where to get the substring fromlength
- the length of the substring
SQLException
- if there is an error accessing the
CLOB
public long position(String searchstr, long start) throws SQLException
searchstr
begins within the CLOB
value that
this Clob
object represents. The search for
searchstr
begins at position start
.
position
in interface Clob
searchstr
- the byte array for which to searchstart
- the position at which to begin searching; the first position
is 1
SQLException
- if there is an error accessing the
CLOB
public long position(Clob searchstr, long start) throws SQLException
Clob
object searchstr
begins within the CLOB
value
that this Clob
object represents. The search for
searchstr
begins at position start
.
position
in interface Clob
searchstr
- the byte array for which to searchstart
- the position at which to begin searching; the first position
is 1
SQLException
- if there is an error accessing the
CLOB
public OutputStream setAsciiStream(long pos) throws SQLException
setAsciiStream
in interface Clob
pos
- the position where to start the stream
clob
object
SQLException
- if there is an error accessing the clob
public Writer setCharacterStream(long pos) throws SQLException
setCharacterStream
in interface Clob
pos
- the position where to start the writer
clob
object
SQLException
- if there is an error accessing the clob
public int setString(long pos, String str) throws SQLException
setString
in interface Clob
pos
- the position where to set the stringstr
- string to insert in the clob
SQLException
- if there is an error accessing the clob
public int setString(long pos, String str, int offset, int len) throws SQLException
setString
in interface Clob
pos
- the positionstr
- the stringoffset
- the offsetlen
- the length
SQLException
- if there is an error accessing the clob
public void truncate(long len) throws SQLException
truncate
in interface Clob
len
- the length
SQLException
- if there is an error accessing the clob
public String toString()
toString
in class Object
public void free()
free
in interface Clob
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |