I am trying to store a blob in my database. In my class file I declared it as follows;
Code:
private Blob file;
Code:
/**
* @hibernate.property
* column="file"
*/
public Blob getFile() {
return file;
}
public void setFile(Blob file) {
this.file = file;
}
This seems to work for files less than 5MB but I get the following error for files larger than that.
Code:
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not insert: [com.chisq.common.bo.Document]; uncategorized SQLException for SQL [insert into Document (documentDate, DocumentTypeID, documentTitle, documentSubject, documentHyperlink, documentComment, documentVersion, filename, file, documentSize, mimeType) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [01004]; error code [0]; Data truncation: Data too long for column 'file' at row 1; nested exception is com.mysql.jdbc.MysqlDataTruncation: Data truncation: Data too long for column 'file' at row 1
Has anyone else run into this problem? What would you recomment should I do?
Thanks,
-Joe