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 -> BLOB slow writing, fast reading??

BLOB slow writing, fast reading??

From: Frederik Hansen <roirex_at_post1.tele.dk>
Date: Fri, 29 Oct 1999 08:53:24 +0200
Message-ID: <38194464.391EDB3E@post1.tele.dk>


Hi

Can anyone tell me why it takes about 20 minutes til write 0.5MB to a BLOB field, where reading from a BLOB field with 0.5MB only takes 20 seconds???

This is my writing code (using Java2, and classes12.zip)

oracle.sql.BLOB blob =
((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
OutputStream out = blob.getBinaryOutputStream(); ByteArrayInputStream in = new ByteArrayInputStream(designFile.file); byte[] file = new byte[8000];                         

int read = 0;
while ( (read = in.read(file, 0, file.length)) != -1 )

        out.write(file, 0, read);
out.close();

And this is my read code :

oracle.sql.BLOB blob =
((oracle.jdbc.driver.OracleResultSet)resl).getBLOB(1);
                                

BufferedInputStream in = new
BufferedInputStream(blob.getBinaryStream()); ByteArrayOutputStream out = new ByteArrayOutputStream();                                 

byte[] file = new byte[8000];                                 

int read = 0;
while ((read = in.read(file, 0, file.length)) > 0)

        out.write(file, 0, read);
in.close();

--
Venlig hilsen
Frederik Received on Fri Oct 29 1999 - 01:53:24 CDT

Original text of this message

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