Download Oracle Streams Advanced Queuing User's Guide and Reference
Transcript
JMS MapMessage Examples
dbms_output.put_line('password: ' || message.get_byte_property('password'));
-- Shows how to retrieve the message payload of aq$_jms_map_message
---------id
'Prepare' sends the content in the PL/SQL aq$_jms_map_message object to
Java stored procedure(Jserv) in the form of byte array.
Passing -1 reserve a new slot within the message store of
sys.aq$_jms_map_message. The maximum number of sys.aq$_jms_map_message
type of messges to be operated at the same time within a session is 20.
Calling clean_body function with parameter -1
might result a ORA-24199 error if the messages currently operated is
already 20. The user is responsible to call clean or clean_all function
to clean up message store.
:= message.prepare(-1);
-- Assume the users know the names and types in the map message payload.
-- The user can use names to get the corresponsing values.
-- These functions are analogous to JMS Java API's. See JMS Types chapter
-- for detail.
dbms_output.put_line('Retrieve payload by Name:');
-- Get a byte entry from the map message payload
dbms_output.put_line('get_byte:' || message.get_byte(id, 'BYTE'));
-- Get a byte array entry from the map message payload
dbms_output.put_line('get_bytes:');
message.get_bytes(id, 'BYTES', blob_data);
display_blob(blob_data);
-- Get another byte array entry from the map message payload
dbms_output.put_line('get_bytes:');
message.get_bytes(id, 'BYTES_PART', blob_data);
display_blob(blob_data);
-- Get a char entry from the map message payload
dbms_output.put_line('get_char:'|| message.get_char(id, 'CHAR'));
-- get a double entry from the map message payload
dbms_output.put_line('get_double:'|| message.get_double(id, 'DOUBLE'));
-- Get a float entry from the map message payload
dbms_output.put_line('get_float:'|| message.get_float(id, 'FLOAT'));
-- Get a int entry from the map message payload
dbms_output.put_line('get_int:'|| message.get_int(id, 'INT'));
-- Get a long entry from the map message payload
dbms_output.put_line('get_long:'|| message.get_long(id, 'LONG'));
-- Get a short entry from the map message payload
dbms_output.put_line('get_short:'|| message.get_short(id, 'SHORT'));
-- Get a String entry from the map message payload
dbms_output.put_line('get_string:');
message.get_string(id, 'STRING', clob_data);
display_clob(clob_data);
-- Assume users do not know names and types in map message payload.
-- User can first retrieve the name array containing all names in the
Oracle JMS Types Examples 16-19
Related documents
Oracle Streams Advanced Queuing User's Guide and Reference
Oracle Streams Advanced Queuing User's Guide and Reference
User Manual - centeractive
User Manual - centeractive
Oracle Database Gateway for DB2 Installation and User's Guide
自己管理データベース: 自動健全性監視および変更
User`s Manual - (DDS) Community RTI Connext Users
Oracle 11g Streams Implementer`s Guide
Service & Support