// 将字CLOB转成STRING类型
public String ClobToString(Clob clob) throws SQLException, IOException {
if (clob==null) {
return "";
}
String reString = "";
Reader is = clob.getCharacterStream();// 得到流
BufferedReader br = new BufferedReader(is);
String s = br.readLine();
StringBuffer sb = new StringBuffer();
while (s != null) {// 执行循环将字符串全部取出付值给StringBuffer由StringBuffer转成STRING
sb.append(s);
s = br.readLine();
}
reString = sb.toString();
return reString;
}
转载于:https://blog.51cto.com/jackielieu/1199819