把oracle 中的clobe 字段转换成String

把oracle 中的clobe 字段转换成String 类型方便使用

View Code
 1 /**
 2      * 把clob类型的数据转换称string 类型
 3      * 作者:母玉山
 4      * 时间:2012-6-6
 5      * @param clob
 6      * @return
 7      * @throws SQLException
 8      * @throws IOException
 9      */
10     public String ClobToString(Clob clob) throws SQLException, IOException {
11         String reString = "";
12         Reader is = clob.getCharacterStream();// 得到流
13         BufferedReader br = new BufferedReader(is);
14         String s = br.readLine();
15         StringBuffer sb = new StringBuffer();
16         while (s != null) {// 执行循环将字符串全部取出付值给StringBuffer由StringBuffer转成STRING
17         sb.append(s);
18         s = br.readLine();
19         }
20         reString = sb.toString();
21         return reString;
22         }
写博----记人生,即人生
原文地址:https://www.cnblogs.com/sane/p/sanemu.html