Re: BLOB question

From: sd <admin_at_classicity.com>
Date: 2000/08/11
Message-ID: <3993DD53.87F7E433_at_classicity.com>#1/1


You can find examples of this at http://www.classicity.com/oracle/

sd



http://www.classicity.com/oracle/
A resource for Oracle JDBC, JSP, PL/SQL

Manolis Wallace wrote:
>
> Tried it guys, but this was the unfortunate result:
> java.sql.SQLException: ORA-01407: cannot update
> ("MILKO"."BINARY_DATA"."BDATA") to NULL
>
> Any ideas?
>
> Be well!
>
> susantha222_at_my-deja.com wrote:
>
> > Vincent,
> >
> > I think the following code will be helpful to update/insert data to a
> > blob field.
> >
> > /* following readStreamFromFile returns the content of a
> > random access file (aImageFile) as bytes.
> > con - connection
> > */
> >
> > byte[] aLogoInBytes = readStreamFromFile(aImageFile);
> >
> > PreparedStatement aprepstmt =
> > con.prepareStatement
> > ("UPDATE pub_info SET logo = ? WHERE pub_id='0736'");
> > ByteArrayInputStream abais = new ByteArrayInputStream
> > (aLogoInBytes);
> >
> > aprepstmt.setBinaryStream(1,abais, aLogoInBytes.length);
> > aprepstmt.executeUpdate();
> > con.commit();
> >
> > Good lick.
> > Susantha.
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
 

-- 
=================
Everything GTA related
Visit http://www.classicity.com
Received on Fri Aug 11 2000 - 00:00:00 CEST

Original text of this message