setString(long pos, String str, int offset, int len)
public int setString(long pos, String str, int offset, int len) throws SQLException
将 str 的 len 个字符(从字符 offset 开始)写入此 Clob 表示的 CLOB 值中。该字符串将从位置 pos 开始重写 Clob 对象中的现有字节。如果在写入 给定字符串时到达 Clob 值的末尾,则将增加 Clob 值的长度,以容纳额外的 字符。
注:如果为 pos 指定的值大于 CLOB 值的长度+1,则行为是不确定的。一 些 JDBC 驱动程序可能抛出 SQLException,而另一些驱动程序可能支持此操 作。
参数:
pos - 开始写入此 CLOB 对象的位置;第一个位置是 1。
str - 要写入此 Clob 对象表示的 CLOB 值中的字符串。
offset - str 中开始读取要写入字符的偏移量。
len - 要写入的字符数。
返回:
写入的字符数。
抛出:
SQLException - 如果访问 CLOB 值时发生错误,或者 pos 小于 1。
SQLFeatureNotSupportedException - 如果 JDBC 驱动程序不支持此方法。
streamClosed(WatchableOutputStream out) public void streamClosed(WatchableOutputStream out) 关闭所指定的 out 流。
truncate(long length) public void truncate(long length) throws SQLException 截取此 Clob 指定的 CLOB 值,使其长度为 length 个字符。
参数:
length- CLOB 值应被截取的字符长度。
抛出:
SQLException - 如果访问 CLOB 值时发生错误,或者 len 小于 0。
SQLFeatureNotSupportedException - 如果 JDBC 驱动程序不支持此方法。
writerClosed(WatchableWriter out)
public void writerClosed(WatchableWriter out)
关闭指定 out 流。
writerClosed(char[] charDataBeingWritten)
public void writerClosed(char[] charDataBeingWritten)
将指定 char[]赋值给该 Clob 对象的 charData 属性。
com.gbase.jdbc.Clob 示例: 参考 2.5.3 小节示例




