ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sanjay Goel <sanjay.g...@gmail.com>
Subject Re: Problem with BLOB
Date Mon, 19 Sep 2005 12:48:07 GMT
The result map looks like this:
<resultMap class="AuditVO" id="audit">
<result property="id" column="TF_AUDIT_ID"></result>
<result property="accId" column="SS_CLIENT_ACC_ID"></result>
<result property="message" column="CHAR_DATA"></result>
</resultMap>

and AuditVO class has
private Integer id;
private int accId;
private byte [] message;
and the getter setter methods.

the querys are 
<select id="getAudit" resultMap="audit" parameterClass="AuditVO" >
SELECT TF_AUDIT_ID, SS_CLIENT_ACC_ID, CHAR_DATA FROM tf_audit WHERE 
TF_AUDIT_ID = #id#
</select>

<insert id="insertAudit" parameterClass="AuditVO">
INSERT INTO tf_audit (TF_AUDIT_ID, SS_CLIENT_ACC_ID, CHAR_DATA, 
LAST_UPDATED) VALUES ( #id# , #accId# , #message# , SYSDATE )
</insert>

<update id="updateAudit" parameterClass="AuditVO">
UPDATE tf_audit SET CHAR_DATA=#message# WHERE TF_AUDIT_ID=#id#
</update>

On 9/19/05, Daniel Henrique Ferreira e Silva <dhsilva@gmail.com> wrote:
> 
> Sanjay,
> 
> Are you using a custom type handler?
> How are your config map files?
> 
> Cheers,
> Daniel Silva.
> 
> On 9/19/05, Sanjay Goel <sanjay.goel@gmail.com> wrote:
> > Hi,
> > I am trying a save a String in an oracle BLOB object (I know String can 
> be
> > mapped to CLOB, but lets say I can't use CLOB) ...
> > I have a VO with a field as byte [] which is mapped to the BLOB. I do a
> > String.getBytes() to get the byte array and save it in BLOB and retrieve 
> it
> > using new String(byte []) ...
> > the problem is, the string returned is garbage. Anyone has an idea why 
> this
> > happens ?
> > Regards,
> > Sanjay
> >
>

Mime
View raw message