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: problems in using setAsciiStream() while inserting objects of large sizes

Re: problems in using setAsciiStream() while inserting objects of large sizes

From: bung ho <bung_ho_at_hotmail.com>
Date: 29 Oct 2003 10:05:30 -0800
Message-ID: <567a1b1.0310291005.124da075@posting.google.com>


Amit Soni <amit.soni_at_oracle.com> wrote in message news:<OcKnb.49$sF1.332_at_news.oracle.com>...
> Hi people,
> I am using setAsciiStream() to insert data af size about 22MB. But there
> are two problems in that:
> 1) A parameter of setAsciiStream() is of type int and it takes the
> length of the stream available. So 22MB size cannot be specified using int
> 2) If I use preparedStatement's setAsciiStream() to put data in chunks
> (in a while loop with the chunk size of 2K), only the data of the last
> setAsciiStream() is pushed in the db.
>
> Thanks in advance,
> Amit.

  1. forgive me, but don't int's go up to 2^31 or so? isn't that plenty to describe 22MB?
  2. when you use setAsciiStream(), you shouldn't need to do anything in chunks. you just set the stream and then execute the statement; the jdbc driver then does the read/insert loop on its own. and if i may add 3) what is the datatype of the database column? if it's a clob, perhaps you would be better off explicitly using the oracle CLOB methods.

ps - what version of oracle server, jdbc driver, jdk? Received on Wed Oct 29 2003 - 12:05:30 CST

Original text of this message

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