存值
Clob organdetail =Hibernate.createClob(request.getParameter("organdetail").equals("")?"":request.getParameter("organdetail").trim());// 机构简介
取值 显示JSP
<%=ToolsCommon.Clob2String(institutions.getOrgandetail())==null?"":ToolsCommon.Clob2String(institutions.getOrgandetail())%>
public static String Clob2String(java.sql.Clob clob) {
String s1 = "";
char ac[] = new char[200];
if (clob == null)
return null;
java.io.Reader reader = null;
int i;
try {
reader = clob.getCharacterStream();
while ((i = reader.read(ac, 0, 200)) != -1)
s1 = s1 + new String(ac, 0, i);
} catch (Exception exception1) {
// throw new java.sql.SQLException(exception1.getMessage());
System.out.println(exception1.toString());
}
finally {
try {
reader.close();
} catch (Exception _ex) {
}
}
return s1;
}