The standard JDBC result set returns the blob without any vendor-specific
magic aside from using the correct driver. The actual column type is an
oracle blob and we use that to update the column by writing a stream
supplied by oracle-specific getBinaryOutputStream since there is no
setBytes() on the java.sql.Blob - convenient. At the same time a
FileInputStream should work just fine with setObject (will bet dollars to
donuts) and none of that involves oracle-specific code. The reason believe
that is the code below will only load small "large" objects (doh!) under
jboss. It works fine with a weblogic datasource or with a vanilla JDBC
connection.

    oracle.sql.BLOB blob = (oracle.sql.BLOB)resultSet.getBlob("foo");
    BufferedOutputStream stream = new BufferedOutputStream(
blob.getBinaryOutputStream() );
    stream.write(bytes);
    ...

----- Original Message -----
From: "Stephen Coy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, February 16, 2003 5:22 AM
Subject: Re: [JBoss-user] JMS persistence manager for Oracle8


> On Sunday, February 16, 2003, at 06:51  PM, Rod Macpherson wrote:
>
> >>> I believe the direct support is through Oracle specific API's.
> >
> > FALSE.
> >
> > The JDBC API works fine with the underlying driver which is obviously
> > oracle-specific. There is no problem using LOBs except when using
> > jboss. The
> > same method that works in a stand-alone executable and under weblogic
> > fails
> > in jboss.
>
> Well, I'm happy to be proved wrong. What method are you using in your
> standalone executable?
>
> JBoss is not doing anything particularly funky.
>
> Blobs are set using PreparedStatement.setBinaryStream after first
> marshalling the data into a byte array if necessary.
>
> Blobs are retrieved using ResultSet.getBinaryStream. The byte array is
> recovered and unmarshalled.
>
> A similar approach is taken with Clob data (set/getCharacterStream).
>
> This code works on the multitude of databases supported by JBoss (well
> mostly - MySQL barfs on set/getCharacterStream, but it doesn't do CLOBs
> anyway).
>
> If we can make this work properly with the thin driver, without
> breaking anything else, then we'll be able to eliminate the No 1.
> Oracle-CMP question that keeps coming up.
>
> BTW. You're not using JDBC3 are you?
>
> Regards,
>
> Steve Coy
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to