Hibernate version: 3.1
Name and version of the database you are using: mySQL 4.1
Hi,
I am having trouble working out how to store my byte array to a BLOB. The hibernate website only deals with version 1.2.3, i think...
I used myEclipse to generate the mapping files, but it mapped mySQL BLOB to java.util.String, so I changed it to java.sql.Blob, but I have found that the mySQL Connector/J driver doesnt provide public access to the Blob class.
So, with my byte[], csQ.getPic().getByteArray()
How do I get it into my questionImage field so I can get it into the DB?
<property name="questionImage" type="java.sql.Blob">
<column name="question_image"/>
</property>
Question q = new Question();
q.setQuestionNumber(i);
q.setQuestionText(csQ.getText());
q.setQuestionImage( //????... );
Please help, thank you...
Daniel
|