Hi,

I am also building a servlet to download files from een Oracle DB (8.0.5.
Blob Field). At this moment I'm
putting the data from the DB in a ByteArrayOutputStream. This Stream can be
converted to a byte[] in the
servlet again and can be written to the outstream of the servlet.

Example:
  byte[] buffer = bytearrayfromoracle.toByteArray();

  response.setContentType("txt/xml"); // What ever mime-type
                                      // you want to send.
  response.setContenLength( buffer.length);

  ServletOutputStream out = response.getOutputStream();

  out.write(buffer);
  out.flush();
  out.close();

The example to fill the bytearray from Oracle can be found in the JDBC
example directory from Oracle.

The only probleem I still have is that I can read only 10 bytes in 1 call to
the database. For big file this
is deadly. For small file it will work but is not very fast.

Bye.


----- Original Message -----
From: cksdfksdkf wwer <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, August 09, 2000 4:28 PM
Subject: Down loading filedata from oracle DB


> Hi
>
> I would like to download data(txt/xml file) from
> oracle DB...
> on to client system once he clikes the file he
> wann't...(HTML page)
>
> I am able to down load txt from fron local drive ...
> and able(stand alone application) to connect to DB
> read the data as clob data type..(classes12_01.zip)
>
> but i am facing  peoblem...with servlet connecting to
> db.. and downloading...
> any code snipt  or example will help...
>
> thanks in adv
>
>
> __________________________________________________
> Do You Yahoo!?
> Kick off your party with Yahoo! Invites.
> http://invites.yahoo.com/
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
> ____________________________________________________________
> Get your FREE personal .com domain name and
> NAMEzero Personal Portal at: http://www.namezero.com.
> For customer service, mailto:[EMAIL PROTECTED].
>

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to