Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The mapping in the JavaTM programming language
for the SQL CLOB
type.
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.
The driver implements a Clob
object 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 it was created.
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
searching for a substring or CLOB
object within a
CLOB
value.
Methods in the interfaces ResultSet
,
CallableStatement
, and PreparedStatement
, such as
getClob
and setClob
allow a programmer to
access an SQL CLOB
value.
This class is new in the JDBC 2.0 API.
Method Summary | |
InputStream |
getAsciiStream()
Gets the CLOB value designated by this Clob
object as a stream of Ascii bytes. |
Reader |
getCharacterStream()
Gets the CLOB value designated by this Clob
object as a Unicode stream. |
String |
getSubString(long pos,
int length)
Returns a copy of the specified substring in the CLOB value
designated by this Clob object. |
long |
length()
Returns the number of characters in the CLOB value
designated by this Clob object. |
long |
position(Clob searchstr,
long start)
Determines the character position at which the specified Clob object searchstr appears in this
Clob object. |
long |
position(String searchstr,
long start)
Determines the character position at which the specified substring searchstr appears in the SQL CLOB value
represented by this Clob object. |
Method Detail |
public long length() throws SQLException
CLOB
value
designated by this Clob
object.CLOB
in charactersSQLException
- if there is an error accessing the
length of the CLOB
public 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.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 copiedString
that is the specified substring in
the CLOB
value designated by this Clob
objectSQLException
- if there is an error accessing the
CLOB
public Reader getCharacterStream() throws SQLException
CLOB
value designated by this Clob
object as a Unicode stream.CLOB
dataSQLException
- if there is an error accessing the
CLOB
valuepublic InputStream getAsciiStream() 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
searchstr
appears in the SQL CLOB
value
represented by this Clob
object. The search
begins at position start
.searchstr
- the substring for which to searchstart
- the position at which to begin searching; the first position
is 1SQLException
- if there is an error accessing the
CLOB
valuepublic long position(Clob searchstr, long start) throws SQLException
Clob
object searchstr
appears in this
Clob
object. The search begins at position
start
.searchstr
- the Clob
object for which to searchstart
- the position at which to begin searching; the first
position is 1Clob
object appears,
else -1; the first position is 1SQLException
- if there is an error accessing the
CLOB
value
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.