I have been trying to figure this out for over a week now and it's getting on my nerves that I can't figure it out. So I'm reaching out to the
Java community to try to get some answers...
I am using Hibernate 3.2.5 for ORM and Spring 2.5.6 for MVC. My database is Oracle 11g. I am using ojdbc6.jar from Oracle 11g.
So far, I have been able to successfully store files <4K into the database. I followed instructions from several web sources attempting to allow larger files to be inserted and have failed to find a working solution.
Here is my code as it is now...
The following is the entity class with annotations:
This is my Hibernate configuration:
Here is the DAO code where I insert into the database:
I have adjusted this code several times. I have reverted back to my original attempt to try to simplify the process of trying other methods. Please help me by posting your solutions for inserting large files into BLOB objects in Oracle using Hibernate.
Here is a list of resources I have looked at (although I have seen many more):
http://web.archive.org/web/20090224215158/http://hibernate.org/56.htmlhttp://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/http://download.oracle.com/javase/6/docs/api/javax/sql/rowset/serial/SerialBlob.htmlhttp://blog.ovo.cz/2009/05/oracle-blob-in-java.htmlhttp://www.dil.univ-mrs.fr/~massat/docs/hibernate-3.1/api/org/hibernate/lob/SerializableBlob.htmlhttp://java-x.blogspot.com/2007/01/handling-oracle-large-objects-with-jdbc.html