getCharacterStream(long pos, long length)
public Reader getCharacterStream(long pos, long length)
throws SQLException
返回包含部分 Clob 值的 Reader 对象,该值从 pos 指定的字符开始,长 度为 length 个字符。
参数:
pos - 将获取的部分值第一个字符的偏移量。Clob 中的第一个字符在位置 1 处。
length - 要获取的部分值的字符长度。
返回:
Reader,可以通过它来读取部分 Clob 值。
抛出:
SQLException - 如果 pos 小于 1,或者 pos 大于 Clob 中的字符数,或 者 pos + length 大于 Clob 中的字符数
SQLFeatureNotSupportedException - 如果 JDBC 驱动程序不支持此方法
getSubString(long startPos, int length)
public String getSubString(long startPos, int length)
throws SQLException
获取此 Clob 对象指定的 CLOB 值中指定子字符串的副本。子字符串开始 于位置 startPos 处,有 length 个连续字符。
参数:
startPos - 要提取的子字符串的第一个字符。第一个字符位于位置 1 处。
length - 要复制的连续字符的数量;length 的值必须大于等于 0。
返回:
一个 String,它是由此 Clob 对象指定的 CLOB 值中的指定子字符串
抛出:
SQLException - 如果访问 CLOB 值时发生错误;如果 pos 小于 1 或者length 小于 0。
SQLFeatureNotSupportedException - 如果 JDBC 驱动程序不支持此方法。




