store xml file using blobs (MYSQL) using Hibernate

I have tried lot of tutorials regarding storing the files using hibernate but all of them are very complex.I need a simple code that takes any file(txt,xml) and store it on the database using blob using hibernate
[226 byte] By [Qasim-Khana] at [2007-11-27 2:11:20]
# 1
Here's some code of mine that does that:logo.setLogo(Hibernate.createBlob(item.getInputStream()));HibernateUtil.currentSession().save(logo);In this code the object has a property of type Blob whose name is "logo".
DrClapa at 2007-7-12 2:04:19 > top of Java-index,Java Essentials,Java Programming...
# 2

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

Qasim-Khana at 2007-7-12 2:04:19 > top of Java-index,Java Essentials,Java Programming...
# 3

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.

DrClapa at 2007-7-12 2:04:19 > top of Java-index,Java Essentials,Java Programming...
# 4
It didnt work but thanks for your guidance. :)
Qasim-Khana at 2007-7-12 2:04:19 > top of Java-index,Java Essentials,Java Programming...
# 5
> It didnt work but thanks for your guidance. :)I'm not really surprised. Many of the things I did to get Hibernate set up seemed to work by accident.
DrClapa at 2007-7-12 2:04:19 > top of Java-index,Java Essentials,Java Programming...