ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Sheedy" <mobileja...@gmail.com>
Subject blob vs clob in mysql
Date Fri, 31 Oct 2008 00:01:01 GMT
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
    for 'attachments'.  Cause: java.sql.SQLException: Not a valid escape

<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" />

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

View raw message