/** * 将字Clob转成String类型 * <p> * 2017年8月31日 15:24:48 * xj * * @param sc clob对象 * @return String * @throws SQLException * @throws IOException */ public static String ClobToString(Clob sc) throws SQLException, IOException { String reString = ""; // 得到流 Reader is = sc.getCharacterStream(); BufferedReader br = new BufferedReader(is); String s = br.readLine(); StringBuffer sb = new StringBuffer(); // 执行循环将字符串全部取出付值给StringBuffer由StringBuffer转成STRING while (s != null) { sb.append(s); s = br.readLine(); } reString = sb.toString(); return reString; }
更多工具类方法:http://blog.csdn.net/qq_34117825/article/details/78392976