db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Mogley" <michael.mog...@verizon.net>
Subject RE: Fw: oracle lobs implemented
Date Sat, 14 Dec 2002 18:40:27 GMT
Oleg,

Good point. I never even thought about using reflection.  The rest is
implemented exactly as you describe, tested, and working (both blobs and
clobs).

I'll adjust the code accordingly and submit changes early next week.

Michael

> -----Original Message-----
> From: Oleg Nitz [mailto:on@ukr.net]
> Sent: Saturday, December 14, 2002 4:09 AM
> To: OJB Developers List
> Subject: Re: Fw: oracle lobs implemented
> 
> Sorry, I did some mistakes, see corrected version below
> 
> On Saturday 14 December 2002 10:57, Oleg Nitz wrote:
> > Hi Michael,
> >
> > From my experience of working with Oracle BLOBs the only way to
write
> them
> > with the thin Oracle driver is to use
> > oracle.sql.Blob.getBinaryOutputStream() method. In order not to
requre
> > oracle classes in the classpath you may use reflection:
> Method getBinaryOutputStream =
>    Class.forName("oracle.sql.Blob").getMethod("getBinaryOutputStream",
> null);
> OutputStream out = (OutputStream) getBinaryOutputStream.invoke(blob,
> null);
>                                                                ^^^^
> Where the "blob" is read via ps.getBlob() from the database with "FOR
> UPDATE".
> And during the INSERT things become even more interesting: first one
must
> specify "empty_blob()" as a value:
> INSERT INTO table (..., blob_field) VALUES (..., empty_blob())
> then
> SELECT blob_field FROM table FOR UPDATE
> then write value via getBinaryOutputStream as described above.
> 
> Oleg
> 
> --
> To unsubscribe, e-mail:
<mailto:ojb-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:ojb-dev-help@jakarta.apache.org>


Mime
View raw message