/** * 將字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