Hi Jeff, the result type is indeed byte[]. The strange thing is that it works fine when using CLOB as the jdbcType, but not BLOG or LONGVARBINARY. I used abator to create the initial mapping, but I'm actually a bit unclear about the purpose of LONGVARBINARY. Any idea what the difference is between that and BLOG? I know CLOB is supposed to be used for character data...
Cheers, Jason 2008/11/1 Jeff Butler <[EMAIL PROTECTED]> > What is the Java type of the file_data propoerty in your result > class? Should be byte[] for a BLOB. > > Jeff Butler > > On Thu, Oct 30, 2008 at 7:01 PM, Jason Sheedy <[EMAIL PROTECTED]> > wrote: > > Hi, > > I'm new to this list, so please excuse be kind. I'm trying to get my head > > around using blobs with ibatis/mysql and have run into an issue when > trying > > to read the blobs back into my result map. > > > > For some unknown reason using BLOB or LONGVARBINARY for the jdbcType on > my > > result map throws a strange exception. The binary data is written > > correctly, but when i try and read it in i get the following exception. > > > > com.ibatis.sqlmap.client.SqlMapException: Error getting nested result map > > values > > for 'attachments'. Cause: java.sql.SQLException: Not a valid escape > > sequence: > > > > <resultMap id="compositeAttachment" class="........EQAttach" > > > <result column="eq_attach_id" property="eqAttachId" > jdbcType="INTEGER" > > /> > > <result column="eq_id" property="eqId" jdbcType="INTEGER" /> > > <result column="file_name" property="fileName" jdbcType="VARCHAR" /> > > <result column="file_size" property="size" jdbcType="SMALLINT" /> > > <result column="file_data" property="fileContent" jdbcType="BLOB" /> > > </resultMap> > > > > The really strange thing is that everything works ok if I user CLOB as > the > > jdbcType. My data type on the mysql field is blob. > > > > Any tips would be appreciated. > > > > > > -- > > Jason Sheedy > > www.bytespring.com > > www.jmpj.net > > > --------------------------------------------------------------------------------------------- > > > --------------------------------------------------------------------------------------------- > > > -- Jason Sheedy www.bytespring.com www.jmpj.net --------------------------------------------------------------------------------------------- ---------------------------------------------------------------------------------------------
