ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Clinton Begin (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-44) BLOB retrieve
Date Thu, 06 Jan 2005 15:57:12 GMT
     [ http://issues.apache.org/jira/browse/IBATIS-44?page=comments#action_57353 ]
     
Clinton Begin commented on IBATIS-44:
-------------------------------------


You probably just needed to add jdbcType="BLOB" and possibly javaType="byte" explicitly to
the result.  iBATIS doesn't access result set metadata for this (for performance and compatibility
reasons).

Note:  I've removed the ibatisClob.zip from the above mentioned issue, as it contained an
incompatible license agreement.  They should all work the same way anyway...it's "standard"
JDBC.

Cheers,
Clinton

> BLOB retrieve
> -------------
>
>          Key: IBATIS-44
>          URL: http://issues.apache.org/jira/browse/IBATIS-44
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>     Versions: 2.0.9
>  Environment: windows xp
> jdk 1.4.2 
> oracle 9i
> ojdbc14_g.jar
>     Reporter: Alexandru Barbat

>
> It seems it doesn't retrieve correctly BLOB fields from db.
> the "conversion" from (db type) BLOB to byte[] (java type) it is not working as expected.
> code extract"
> map look something like this
> ...
>  <resultMap id="sea-levels-result" class="sea">
>   <result property="idSea" column="IDSEA"/>
>   <result property="value" column="SEA_LEVEL"/>
>   <result property="dsca" column="DSCA"/>
>   <result property="image" column="IMG" />
>  </resultMap>
>  <select id="getSeaLevels" parameterClass="string" resultMap="sea-levels-result">
>    select IDSEA as IDSEA,
>    	SEA_LEVEL as SEA_LEVEL,
> 	DSCA as DSCA,
> 	IMG 
>    from SEA
>    where ID=#value#
>  </select>
> ...
> property "image" has byte[] type and column "IMG" has BLOB type
> the call is something like this:
> ...
>  List res = getSqlMap().queryForList("getSeaLevels", id);
> ..
> the problem is that in the propery 'image' of class 'sea' I will find 86 bytes (but in
reality are only 10)
> and those 86 bytes are not the same at all with those 10.  
> If somebody could help I'll appreciate. 
> I have searched for a similar example but I didn't found any.
> ps
> the update to a BLOB field seems to work very well.
> Thanks.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message