Want to send CLOB/CLOB to Oracle AQ from Java

B

brian.vanheesch

I have an Oracle type which includes a CLOB field. I have, in Java, a
class which implements SQLData & defines writeSQL & readSQL, etc
methods. I can receive all data types (including CLOB/BLOB), but
cannot send CLOB/BLOB objects to an AQ.

The interface defines writeClob(Clob c), but my question is how to
construct the Clob object in java?

Using Oracle's implementation of JDBC, I can do:

CLOB c=CLOB.empty_lob();
c.putString(0, "foobar");
stream.writeClob(c);

But get an "Invalid empty LOB operation" error since the LOB was not
previous saved to the database.

Do I need to INSERT the data into a database table first, then SELECT
it from the table, just to publish it to an AQ? Then go back & DELETE
it from the table?

All of the examples I have found do not include CLOB/BLOB objects being
saved to an AQ.

bvh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top