Hello All,<br>I&#39;ve been using hibernate with mysql for a while now with
great success.&nbsp; I searched everywhere and could not find a solution to
this problem, so thanks for any support you can provide.<br><br>I&#39;m
currently storing some data as a byte[] in an object and stored in the
mysql database as a blob.&nbsp; This was seamless with hibernate and had no
issues.&nbsp; I need to now deal with the data as a stream as it&#39;s bad form
to carry a 5mb byte[].<br>
<br>I added the methods to the object : <br>java.sql.Blob getBlob() and setBlob( java.jql.Blob) <br>and added the : <br>&lt;property name=&quot;blob&quot; type=&quot;binary&quot; /&gt; (tested with and without the type=&quot;binary&quot;)<br>

<br>I get the following error if I don&#39;t set the blob (would be null)<br>And I recreate the DB each time.&nbsp; I get the following error when inserting the object:<br>Hibernate: insert into AUDIO (bytes, name, contentType, blob) values (?, ?, ?, ?)<br>

Exception in thread &quot;main&quot; org.hibernate.exception<div id="1eqx" class="ArwC7c ckChnd">.SQLGrammarException: could not insert: [com.polling.Audio]<br>Caused
by: java.sql.SQLException: You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near &#39;blob) values (_binary&#39;\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&#39;, null, null, nul&#39; at line 1<br>
<br>And I get the following error if I do set the blob with a simple: audio1.setBlob( Hibernate.createBlob( new byte[1] ) );<br>Exception in thread &quot;main&quot; java.lang.ClassCastException: org.hibernate.lob.SerializableBlob<br>

<br>Environment: <br>Windows Xp sp2<br>java 1.5.0_04<br>Mysql 5.0.20-nt<br>Hibernate 3.2<br><br>Thanks again for any help.<br><font color="#888888"><br>-james</font></div>