|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objectweb.cjdbc.driver.Clob
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.
Field Summary | |
private static long |
serialVersionUID
|
private java.lang.String |
stringData
The data represented as a string of this CLOB |
Constructor Summary | |
Clob(java.lang.String data)
Creates a new Clob instance. |
Method Summary | |
java.io.InputStream |
getAsciiStream()
Retrieves the CLOB value designated by this
Clob instance as a stream. |
java.io.Reader |
getCharacterStream()
Materializes the CLOB value designated by this object
as a stream of Unicode character. |
java.lang.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(java.sql.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(java.lang.String searchstr,
long start)
Retrieves the character position at which the specified string searchstr begins within the CLOB value that
this Clob object represents. |
java.io.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. |
java.io.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,
java.lang.String str)
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)
Writes len characters of str, starting at character offset, to the CLOB value that this Clob represents. |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final long serialVersionUID
private java.lang.String stringData
CLOB
Constructor Detail |
public Clob(java.lang.String data)
Clob
instance.
data
- a String
of character dataMethod Detail |
public long length() throws java.sql.SQLException
CLOB
value designated by this
Clob
object
length
in interface java.sql.Clob
CLOB
value that this clob
represents
java.sql.SQLException
- if there is an error accessing the length of the
CLOB
public java.io.InputStream getAsciiStream() throws java.sql.SQLException
CLOB
value designated by this
Clob
instance as a stream.
getAsciiStream
in interface java.sql.Clob
CLOB
data
java.sql.SQLException
- if there is an error accessing the
CLOB
valuepublic java.io.Reader getCharacterStream() throws java.sql.SQLException
CLOB
value designated by this object
as a stream of Unicode character.
- Specified by:
getCharacterStream
in interface java.sql.Clob
- Returns:
- A reader object with all the data in the
CLOB
value
designated by this clob object as unicode characters.
- Throws:
java.sql.SQLException
- if there is an error accessing the
CLOB
value
public java.lang.String getSubString(long pos, int length) throws java.sql.SQLException
CLOB
value represented
by this CLOB
object that starts at position position
and has ip to length consecutive characters.
getSubString
in interface java.sql.Clob
pos
- the position where to get the substring fromlength
- the length of the substring
java.sql.SQLException
- if there is an error accessing the
CLOB
public long position(java.lang.String searchstr, long start) throws java.sql.SQLException
searchstr
begins within the CLOB
value that
this Clob
object represents. The search for
searchstr
begins at position start
.
position
in interface java.sql.Clob
searchstr
- the byte array for which to searchstart
- the position at which to begin searching; the first position
is 1
java.sql.SQLException
- if there is an error accessing the
CLOB
public long position(java.sql.Clob searchstr, long start) throws java.sql.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 java.sql.Clob
searchstr
- the byte array for which to searchstart
- the position at which to begin searching; the first position
is 1
java.sql.SQLException
- if there is an error accessing the
CLOB
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
setAsciiStream
in interface java.sql.Clob
pos
- the position where to start the stream
clob
object
java.sql.SQLException
- if there is an error accessing the clob
public java.io.Writer setCharacterStream(long pos) throws java.sql.SQLException
setCharacterStream
in interface java.sql.Clob
pos
- the position where to start the writer
clob
object
java.sql.SQLException
- if there is an error accessing the clob
public int setString(long pos, java.lang.String str) throws java.sql.SQLException
setString
in interface java.sql.Clob
pos
- the position where to set the stringstr
- string to insert in the clob
java.sql.SQLException
- if there is an error accessing the clob
public int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLException
setString
in interface java.sql.Clob
pos
- the positionstr
- the stringoffset
- the offsetlen
- the length
java.sql.SQLException
- if there is an error accessing the clob
public void truncate(long len) throws java.sql.SQLException
truncate
in interface java.sql.Clob
len
- the length
java.sql.SQLException
- if there is an error accessing the clob
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |