db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jorge" <jorge.uria...@coverlink.com>
Subject Re: clobs using torque and oracle
Date Fri, 31 Jan 2003 17:19:36 GMT
We've been successfully using Torque (b2-3¿?) with Oracle for some months
now.

      Iterator iteradorBins = listaBins.iterator();
      while (iteradorBins.hasNext()) {
        HaMedioBin elementoBin = (HaMedioBin) iteradorBins.next();
        // Y escribimos en disco cada uno de ellos
        try {
          DataOutputStream salida = new DataOutputStream(new
FileOutputStream(pathDondeGuardar + uriMedioAGuardar));
          salida.write(elementoBin.getBinario());
          salida.close();
        } catch (Exception e) {
          cat.error("Error de E/S en guardarEnDisco(" + uriMedioAGuardar +
", " + pathDondeGuardar + "): " + e);
        }
      }

works fine for a schema like

 <table name="HA_MEDIO_BIN">
  <column name="IDMEDIOBIN" required="true" primaryKey="true" type="BIGINT"
autoIncrement="true"/>
  <column name="IDMEDIO" required="true" type="BIGINT"/>
  <column name="BINARIO" type="BLOB"/>
  <foreign-key foreignTable="HA_MEDIO">
   <reference foreign="IDMEDIO" local="IDMEDIO"/>
  </foreign-key>
 </table>

As a side note, Torque just rocks for me!
No matter it uses village/ojb/whatever, no matter it's not the finest piece
of code in the world... the return on initial efforts is amazing.

Greetings,

_
Jorge



"Geoff Fortytwo" <g42@ign.com> escribió en el mensaje
news:5.1.0.14.2.20030129123039.055373a8@mail.snowball.com...
> Oh. I just noticed the "RE: Torque and LOBs" thread. So apparently Torque
> just doesn't work with LOBs? Has anyone gotten BLOBS or CLOBS to work with
> Torque for any DB (although I'm personally just interested in Oracle)?
>
> At 12:25 PM 1/29/2003, you wrote:
> >Has anyone else succeeded using clobs through torque using oracle? (I'm
> >using Torque 3.0.)
> >
> >I have the schema description:
> >   <table name="Tmp20030129_clob1" javaName="Tmp20030129_clob1"
> > idMethod="none" skipSql="true">
> >     <column
> > name="id"          javaName="Id"          required="true"
type="INTEGER"
> > size="10"  primaryKey="true"/>
> >     <column name="clob1"      javaName="Clob1"      required="false"
> > type="CLOB"/>
> >   </table>
> >
> >In oracle, I created the table as:
> >   create table tmp20030129_clob1
> >   (
> >     id  NUMBER(10)  PRIMARY KEY,
> >     clob1  CLOB
> >   );
> >
> >I did the following insert on that table:
> >insert into tmp20030129_clob1 (id,clob1) values (1,'one');
> >
> >Using Golden32 I was able to look at the contents of that table using
> >select * from tmp20030129_clob1;
> >and the values are there as expected.
> >
> >However, when I use torque to get the value from the DB I get an instance
> >of Tmp20030129_clob1 where "getId()" returns 1 as expected, but
getClob1()
> >returns null. So, it is in fact querying the db because if I do a search
> >for id==2 it doesn't return a Tmp20030129_clob1, it just returns null.
So,
> >for whatever reason, the clob itself is just not being extracted.
> >
> >Am I doing something wrong or are clobs just not supported by the oracle
> >adapter for torque?





Mime
View raw message