数据类型转换错误,数据库中存入的是CLOB格式,获取该字段不能直接转化为String格式。
//将clob转化为String
public String ClobToString(Clob clob) throws SQLException, IOException {
String res= "";
Reader is = clob.getCharacterStream();
BufferedReader br = new BufferedReader(is);
String s = br.readLine();
StringBuffer sb = new StringBuffer();
while (s != null) {
sb.append(s);
s = br.readLine();
}
res= sb.toString();
if(br!=null){
br.close();
}
if(is!=null){
is.close();
}
return res;
}
// String packageDesc = ClobToString((Clob) packageInfo.get("F_PACKAGE_DESC"));