/**
* 当数据库字段为Text类型时调用
* @param rs
* @param col
* @return
*/
public static String getClobString(ResultSet rs, String col) {
try {
Reader reader = rs.getCharacterStream(col);
if (reader == null) {
return null;
}
StringBuffer sb = new StringBuffer();
char[] charbuf = new char[4096];
for (int i = reader.read(charbuf); i > 0; i = reader.read(charbuf)) {
sb.append(charbuf, 0, i);
}
return sb.toString();
} catch (Exception e) {
return "";
}
}