赞
踩
记录一下 ,使用Java将clob 转 字符串
- /**
- * clob 转 字符串
- * @param clob
- * @return
- * @throws SQLException
- * @throws IOException
- */
- /**
- * Clob类型 转String
- */
- public static String clobToString(Clob clob) throws SQLException, IOException {
- String str = "";
- Reader reader = clob.getCharacterStream();
- BufferedReader br = new BufferedReader(reader);
- String readLine = br.readLine();
- StringBuilder sb = new StringBuilder();
- while (readLine != null) {
- sb.append(readLine);
- readLine = br.readLine();
- }
- str = sb.toString();
- br.close();
- reader.close();
- return str;
- }
![](https://csdnimg.cn/release/blogv2/dist/pc/img/newCodeMoreWhite.png)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。