The consensus so far seems to be that the 9.x and earlier drivers are
a bit flaky in this area, but that the 10.x drivers work better.

Larry


On Tue, 11 Jan 2005 10:24:13 +0100 (CET), Bostjan Dolenc (JIRA)
<ibatis-dev@incubator.apache.org> wrote:
>      [ 
> http://issues.apache.org/jira/browse/IBATIS-44?page=comments#action_57497 ]
> 
> Bostjan Dolenc commented on IBATIS-44:
> --------------------------------------
> 
> I have the same issue. I can write BLOBs without problems and I get correct 
> data back when using another tool (say PL/SQL Developer). But if I read them 
> through an SqlMap, I always get back 128 bytes. I think they are always the 
> same no mattter what I put in the BLOB.
> 
> When using plain JDBC, I get the same symptom if I use ResultSet.getBytes. 
> ResultSet.getInputStream gives correct data. I stil have to investigate 
> whether this happens on all Oracle drivers (all combinations of 9.2/10 
> database and thin/OCI drivers).
> 
> > 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
> 
>

Reply via email to