How to convert multipartfile into Blob type

hibernate

Solution

MultipartFile savedFile;
savedFile=itemView.getImgFile();//file from model attribute 
Blob blob=Hibernate.createBlob(savedFile.getInputStream()); // hibernate method for create blob 
//Save method will be call here 

http://viralpatel.net/blogs/tutorial-save-get-blob-object-spring-3-mvc-hibernate/ i followed above tutorial

Problem

Hi I am working with saving Image into DB,I am Taking Image as Multipart and trying to convert into `Blob` type. I do this method: ``` Blob blob=Hibernate.getLobCreator(sessionFactory.getCurrentSession()).createBlob(multipartFile.getInputStream(),multipartFile.getSize()); ``` But getting `Nullpointer Exception While Executing`. the file is Unable to convert multipart into `Blob`, any other Method to saving Image into DB.

Original source