public Blob newBlobByInputStream(InputStream inputStream){ Blob blob = null; try{ blob = Hibernate.getLobCreator(getCurrentSession()).createBlob(inputStream,inputStream.available()); }catch(Exception e){ } return blob; }
public Blob newBlobByInputStream(InputStream inputStream){ Blob blob = null; try{ blob = Hibernate.createBlob(inputStream); }catch(Exception e){ } return blob; }
public Blob newBlobByString(String str){ Blob blob = null; try{ blob = new SerialBlob(str.getBytes("UTF-8"));//String 转 blob }catch(Exception e){ } return blob; }