public String blobToString(Blob blob) throws Exception {
if (null != blob) {
try {
InputStream inStream = blob.getBinaryStream();
byte[] data = new byte[1024];
StringBuilder blobToStr = new StringBuilder();
int n;
String s;
while( (n=inStream.read(data)) != -1){
s=new String(data,0,n,CharEncoding.ISO_8859_1);
blobToStr.append(s);
}
inStream.close();
String reStr = DbUtil.cmps(blobToStr.toString());
return reStr;
} catch (Exception e) {
e.printStackTrace();
}
}
return "";
}
Oracle