public interface Clob
CLOB类型在java编程语言的映射™。一个SQL
CLOB内置式存储字符大对象中的行中的数据库表列值。默认情况下,驱动程序实现一个
Clob对象使用一个SQL
locator(CLOB),这意味着一个
Clob对象包含一个逻辑指向SQL
CLOB数据而不是数据本身。一个
Clob对象是有效的交易中,它产生的时间。
的Clob接口提供了获取SQL CLOB长度方法(字符大对象)的价值,实现CLOB值对客户端和搜索字符串或CLOB在CLOB值对象。方法在接口ResultSet,CallableStatement,和PreparedStatement,如getClob和setClob允许程序员访问SQL CLOB价值。此外,该接口已更新CLOB值的方法。
在Clob接口的所有方法都必须完全执行如果JDBC驱动程序支持的数据类型。
| Modifier and Type | Method and Description |
|---|---|
void |
free()
这种方法使
Clob对象并释放资源,它拥有的资源。
|
InputStream |
getAsciiStream()
检索指定的
Clob对象作为一个ASCII流
CLOB价值。
|
Reader |
getCharacterStream()
检索
CLOB值指定的
Clob对象作为一个
java.io.Reader对象(或字符流)。
|
Reader |
getCharacterStream(long pos, long length)
返回一个
Reader对象包含一个部分
Clob价值,从指定的POS机的特点,这是长度的字符。
|
String |
getSubString(long pos, int length)
得到一份在
CLOB值指定的子字符串指定的
Clob对象。
|
long |
length()
在
CLOB检索值的字符数指定的
Clob对象。
|
long |
position(Clob searchstr, long start)
检索字符位置在指定的
Clob对象
searchstr出现在这
Clob对象。
|
long |
position(String searchstr, long start)
检索字符位置在指定的子字符串
searchstr出现在SQL
CLOB
Clob对象表示的值。
|
OutputStream |
setAsciiStream(long pos)
检索一个流是用来写字的ASCII字符,这
Clob对象代表
CLOB价值,开始位置
pos。
|
Writer |
setCharacterStream(long pos)
检索一个流来写一个流的Unicode字符,这
Clob对象代表
CLOB值,在位置
pos。
|
int |
setString(long pos, String str)
写了
String java的
CLOB值,这
Clob对象指定的位置
pos。
|
int |
setString(long pos, String str, int offset, int len)
写
str
len字符,在字符
offset,这种
Clob代表
CLOB价值。
|
void |
truncate(long len)
截断这
Clob指定长度的字符有
len
CLOB价值。
|
long length()
throws SQLException
CLOB检索值的字符数指定的
Clob对象。
CLOB长度
SQLException -如果有一个错误的
CLOB访问值的长度
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
String getSubString(long pos, int length) throws SQLException
CLOB值指定的子字符串指定的
Clob对象。子串的开始位置
pos已达
length连续字符。
pos的子字符串的第一个字符提取。第一个字符在位置1。
length -连续的字符数被复制;长度的值必须大于或等于0
String指定子串在
CLOB值指定的
Clob对象
SQLException -如果有错误访问
CLOB值;如果POS小于1或长度小于0
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
Reader getCharacterStream() throws SQLException
Clob检索对象指定为
java.io.Reader对象的
CLOB值(或字符流)。
CLOB数据
java.io.Reader对象
SQLException -如果有错误访问
CLOB价值
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
setCharacterStream(long)
InputStream getAsciiStream() throws SQLException
CLOB值指定的
Clob对象作为一个ASCII流。
CLOB数据
java.io.InputStream对象
SQLException -如果有错误访问
CLOB价值
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
setAsciiStream(long)
long position(String searchstr, long start) throws SQLException
searchstr出现在SQL
CLOB
Clob对象表示的值。搜索位置
start开始。
searchstr -要搜索的字符串
start在哪个位置开始搜索;第一位为1
SQLException -如果POS小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
long position(Clob searchstr, long start) throws SQLException
Clob对象
searchstr出现在这
Clob对象。搜索位置
start开始。
searchstr -要搜索的对象的
Clob
start在哪个位置开始搜索;第一位为1
Clob对象出现或1如果它是不存在的;第一位为1
SQLException -如果开始小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
int setString(long pos,
String str)
throws SQLException
String java的
CLOB值,这
Clob对象指定的位置
pos。该字符串将覆盖现有的字符在
Clob对象从位置
pos。如果
Clob值的结束而写作给定字符串,然后对
Clob值的长度将增加以容纳额外的字符。
注:如果指定pos价值大于长度+ 1的CLOB价值的行为是未定义的。一些JDBC驱动程序可能在其他司机可能支持此操作把一SQLException。
pos位置开始写作,这
Clob对象代表
CLOB价值;第一位为1
str -被写入,这
Clob指定
CLOB值的字符串
SQLException -如果POS小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
int setString(long pos,
String str,
int offset,
int len)
throws SQLException
str
len字符,在字符
offset,这种
Clob代表
CLOB价值。该字符串将覆盖现有的字符在
Clob对象从位置
pos。如果
Clob值的结束而写作给定字符串,然后对
Clob值的长度将增加以容纳额外的字符。
注:如果指定pos价值大于长度+ 1的CLOB价值的行为是未定义的。一些JDBC驱动程序可能在其他司机可能支持此操作把一SQLException。
pos位置开始写这
CLOB对象;第一位为1
str -被写入,这
Clob对象代表
CLOB值的字符串
str开始读取的字符被写入
offset -
len -字符数要写
SQLException -如果POS小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
OutputStream setAsciiStream(long pos) throws SQLException
CLOB值,这
Clob对象代表,开始位置
pos。写入到流中的字符将改写现有的字符在
Clob对象从位置
pos。如果对
Clob值结束而写的字符流,然后对
Clob值的长度将增加以容纳额外的字符。
注:如果指定pos价值大于长度+ 1的CLOB价值的行为是未定义的。一些JDBC驱动程序可能在其他司机可能支持此操作把一SQLException。
pos位置开始写这
CLOB对象;第一位为1
SQLException -如果POS小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
getAsciiStream()
Writer setCharacterStream(long pos) throws SQLException
Clob对象代表
CLOB值,在位置
pos。写入到流中的字符会覆盖现有的字符在
Clob对象从位置
pos。如果
Clob值的结束而写的字符流,然后对
Clob值的长度将增加以容纳额外的字符。
注:如果指定pos价值大于长度+ 1的CLOB价值的行为是未定义的。一些JDBC驱动程序可能在其他司机可能支持此操作把一SQLException。
pos位置开始写的
CLOB价值;第一位为1
SQLException -如果POS小于1有错误值或访问
CLOB
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
getCharacterStream()
void truncate(long len)
throws SQLException
Clob指定长度的字符有
len
CLOB价值。
注:如果指定pos价值大于长度+ 1的CLOB价值的行为是未定义的。一些JDBC驱动程序可能在其他司机可能支持此操作把一SQLException。
len的长度,字符,而
CLOB值应被截断
SQLException -如果len小于0时有一个错误的
CLOB值或访问
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
void free() throws SQLException
Clob对象并释放资源,它拥有的资源。物体一旦
free方法是无效的。
在free一直叫,任何试图调用其他比free将导致SQLException抛出一个方法。如果free调用多次,以free随后电话被视为一个空操作。
SQLException -如果出现错误释放CLOB的资源
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
Reader getCharacterStream(long pos, long length) throws SQLException
Reader对象包含一个部分
Clob价值,从指定的POS机的特点,这是长度的字符。
pos -偏移量的部分值的第一个字符进行检索。在CLOB的第一个字符位置为1。
length在部分价值特征长度要检索。
Reader通过这部分
Clob值可以读取。
SQLException如果POS小于1或者大于
Clob POS中的字符数或如果POS +长度大于在
Clob字符数
SQLFeatureNotSupportedException如果JDBC驱动程序不支持此方法
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.