ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <lmead...@apache.org>
Subject Re: MySQL and Blob
Date Sun, 01 Jul 2007 16:30:48 GMT
Did you try it w/o the jdbcType and javaType?

Larry


On 7/1/07, Mark P Ashworth <info@connext.co.za> wrote:
>
> Good Day,
>
> I am trying to insert a byte[] field into a MySQL database.
>
>   <resultMap id="EmailResult" class="Email">
>     <result property="id" column="email_id"/>
>     <result property="name" column="name"/>
>     <result property="subject" column="subject"/>
>     <result property="from" column="from"/>
>     <result property="body" column="body" jdbcType="BLOB" javaType="[B"/>
>     <result property="type" column="type" />
>   </resultMap>
>
>   <insert id="insertEmail" parameterClass="Email">
>     insert into email (
>       name,
>       subject,
>       from,
>       body,
>       type
>     ) values (
>       #name#,
>       #subject#,
>       #from#,
>       #body#,
>       #type#
>     )
>   </insert>
>
>  When I look at the SQL generated I see that it has not converted the body
> field correctly so that MySQL will accept the statement.
>
>  insert into email (       name,       subject,       from,       body,
> type     ) values (       'register',       'Test',
> 'info@connext.co.za',       '[B@11381e7',       ''     )
>
> I am using iBatis 2.3.0.677
>
> Regards,
> Mark P Ashworth
> --
> View this message in context: http://www.nabble.com/MySQL-and-Blob-tf4007004.html#a11379634
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message