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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Oracle 9 and Blobs

Re: Oracle 9 and Blobs

From: tojo <Tojo_at_hotmail.com>
Date: Tue, 2 Mar 2004 12:05:18 +0100
Message-ID: <MPG.1aae88c8dabc981b9896dd@news.t-online.de>


In article <4044571A.4010705_at_rwth-aachen.de>, matthias.sondermann_at_rwth- aachen.de says...
> Hi,
>
> normally I use the classical way to fill blob-fields in a database:
> Inserting empty_blob() then select ... for update and updating
>
> But now I tried something like this:
>
> (the table my_table in the Oracle 9 database has only one field from
> type Blob)
>
> String str = "INSERT INTO my_table (?)";
> PreparedStatement stat = getConnection().prepareStatement(str);
> String teststr = "aabbccdd.....";
> stat.setBytes(1, teststr.getBytes());
> stat.executeUpdate();
>
> And it seems to work. Why?
> Are there any problems with it, because I only found informations about
> the first method?
>
> Thank you for answering,
> Matthias
>
>

Gruss Dich Matthias,

both methods will work. The classical way just has a bit more unnecessary work. Just to be safe you can set the default value of your BLOB column to EMPTY_BLOB()

Received on Tue Mar 02 2004 - 05:05:18 CST

Original text of this message

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