Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Any simple example of BLOB
Reading BLOB data
SQLJ Example
long n_read = 200; // read 200 bytes
byte[] bytes;
#sql { call dbms_lob.read(:blob, INOUT n_read, 1, :OUT bytes) };
Equivalent JDBC Example
CallableStatement cs = conn.prepareCall("{call dbms_lob.read(?,?,?,?)}");
((OracleCallableStatement)cs).setBLOB(1, blob); cs.setLong(2, 200);
// read 200 bytes
cs.registerOutParameter(2, Types.NUMERIC); cs.setLong(3, 1);
// Offsetcs.registerOutParameter(4, Types.VARBINARY); cs.executeUpdate();
long n_read =cs.getLong(2); byte[] bytes = cs.getBytes(4); cs.close();
"Kian Lee" <ooiklnews_at_yahoo.com> wrote in message
news:9294ip$khf$1_at_nnrp1.deja.com...
> Hi all,
>
> Do anyone here have a simple workable example that how to insert and
> select for BLOB in Java??
>
> Thanks.
>
> Regards,
> Kian Lee
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Tue Dec 26 2000 - 06:13:26 CST