暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

GBase 数据库小分享 tip

三金先生 2023-11-10
174

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 小节示例 

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论