Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Does Oracle 8.04+ jdbc support BLOB's?

Re: Does Oracle 8.04+ jdbc support BLOB's?

From: Mulreany <mulreany_at_worldnet.att.net>
Date: 17 Jan 1999 00:19:43 GMT
Message-ID: <36A12C8B.8F6DFBCC@worldnet.att.net>


I have used blobs with the OCI drivers and Oracle 8.0.5. I would recommend using the
latest stuff (drivers and db). Generally, it works fine. You use the dbms_lob package to manipulate the blob (read and write). If you have a copy of JDeveloper there is an example (lobexample) that is a good starting point.

A few tips:

Use autocommit false if you are doing updates or you will get an error that the LOB row
is not locked. The update is a two step process to insert the row (and initialize the blob column to null with the empty blob option) and then insert the blob using the locater. Make sure you issue a commit when your done to save the data. You can stream the data out in chunk sizes with 32,000 as the maximum size. If you want to read more than 255 at a time, you must declare the blob output (4th parameter) from dbms_lob write as a longvarbinary field (the example defines it as varbinary).

bjm

Stephen Tahmosh wrote:

> We are using 8.0.4 on AIX 4.3 and have had various JDBC connectivity
> (and other) problems.
> We were using the JDBC OCI driver because it supported LONG data better
> than the Thin driver, but recently Oracle Support told us to switch to
> the thin driver.
>
> We are trying to migrate from LONG to CLOB (and LONG RAW to BLOB) so
> that we can plan for partitioning support in 8i.
> Unfortunately, available information indicates that BLOB/CLOB support is
> only available with the JDBC OCI driver.
>
> QUESTION: Does anyone have any experience that they would share using
> the BLOB/CLOB with Java / JDBC?
> We are trying to find out how best to use BLOBS/CLOBS with Java. We
> don't need the thin driver, as the jdbc drivers are used only in the
> middle tier and do not need to be downloaded.
>
> One would think that the OCI driver would perform better than the thin
> driver.
>
> We are using jdk1.1.6 on AIX 4.3, and Oracle support tentatively told me
> we should use jdk1.1.4, but that may only be related to use of the OCI
> driver.
>
> Any insights much appreciated.
> Thanks,
> Steve Tahmosh
> State Street Corporation
Received on Sat Jan 16 1999 - 18:19:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US