/** * 将Clob对象转换成String对象 * @param clob * @return * @throws SQLException * @throws IOException */ public static String ClobToString(Clob clob) throws SQLException, IOException{ String str=""; Reader reader=clob.getCharacterStream();//得到流 BufferedReader bReader=new BufferedReader(reader); String s = bReader.readLine(); StringBuffer strBuffer = new StringBuffer(); while(s!=null){//执行循环将字符串全部取出附值给StringBuffer由StringBuffer转成String strBuffer.append(s); s=bReader.readLine(); } str=strBuffer.toString(); return str; }
时间: 2024-12-29 10:38:37