aspose file tools*
The moose likes Object Relational Mapping and the fly likes Issue with inserting a BLOB using IBatis DAO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Issue with inserting a BLOB using IBatis DAO" Watch "Issue with inserting a BLOB using IBatis DAO" New topic
Author

Issue with inserting a BLOB using IBatis DAO

hasina kumar
Greenhorn

Joined: Jan 06, 2006
Posts: 9
I am using Oracle Application Server 10g(9.0.4.0.0) with latest version of IBatis. I am uploading a file and inserting file data as byte[] in the database field which is a Blob. I keep on getting SQLException:Data size bigger than max size for this type when i try to insert. If i take out the file data from my insert statement , a record is inserted into the table.

My xml mapping file is:


And my sqlmap-config.xml is
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3716
    
    5

Just a thought but have you tried using a Stream instead of a byte[] array? I know in JDBC clob/blobs can be tricky in that sometimes you have to perform select/insert in two statements instead of one. For example, sometimes you have to read the entire record except the binary data then read each blob/clob separately.


My Blog: Down Home Country Coding with Scott Selikoff
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Issue with inserting a BLOB using IBatis DAO