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" <[EMAIL PROTECTED]> escribi� en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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?
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]