SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
session =sessionFactory.openSession();
xMLSchedules.setExpectedEventId(eventId);
xMLSchedules.setMessage(message);
xMLSchedules.setXmlDetailFile(Hibernate.createBlob(new FileInputStream(file)));
session.saveOrUpdate(xMLSchedules);
session.flush();
session.close();
<hibernate-mapping>
<class name="org.kraysis.webservice.pojo.XMLSchedules" table="xmlschedules">
<id name="expectedEventId" type="int" column="EXPECTED_EVENT_ID" >
<generator class="increment"/>
</id>
<property name="message">
<column name="MSG" />
</property>
<property name="xmlDetailFile" type="binary">
<column name="XML_FILE"/>
</property>
</class>
</hibernate-mapping>
I got this error always
org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
Where I went wrong
Here's another line of code I have:<property name="logo" column="LOGO" type="blob" length="200000"/>
But I am sure that questions about blobs have been asked and answered many times in the Hibernate forum. I don't think this is really the best place to ask your question.