wood burning stoves 2.0*
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

Issue with inserting a BLOB using IBatis DAO

hasina kumar

Joined: Jan 06, 2006
Posts: 9
I am using Oracle Application Server 10g( 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
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3703

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
Similar Threads
Metro-iBATIS Problem while deploying web service using iBatis as mapping techonlogy.
Bean creation Exception
Spring in CMT MDB
How to retrieve metadata in ibatis
iBatis 2, Spring 2.5 - FileNotFoundException: http://www.mybatis.org/dtd/sql-map-config-2.dtd