09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Creating Queue Tables and Queues<br />

Creating a Queue Table and Queue Using Java<br />

public static void runTest(AQSession aq_sess) throws AQException<br />

{<br />

AQQueueTableProperty qtable_prop;<br />

AQQueueProperty queue_prop;<br />

AQQueueTable q_table;<br />

AQQueue queue;<br />

}<br />

/* Creating a AQQueueTableProperty object (payload type - RAW): */<br />

qtable_prop = new AQQueueTableProperty("RAW");<br />

/* Creating a queue table called aq_table1 in aqjava schema: */<br />

q_table = aq_sess.createQueueTable ("aqjava", "aq_table1", qtable_prop);<br />

System.out.println("Successfully created aq_table1 in aqjava schema");<br />

/* Creating a new AQQueueProperty object */<br />

queue_prop = new AQQueueProperty();<br />

/* Creating a queue called aq_queue1 in aq_table1: */<br />

queue = aq_sess.createQueue (q_table, "aq_queue1", queue_prop);<br />

System.out.println("Successfully created aq_queue1 in aq_table1");<br />

/* Get a handle to an existing queue table and queue: */<br />

public static void runTest(AQSession aq_sess) throws AQException<br />

{<br />

AQQueueTable q_table;<br />

AQQueue queue;<br />

}<br />

/* Get a handle to queue table - aq_table1 in aqjava schema: */<br />

q_table = aq_sess.getQueueTable ("aqjava", "aq_table1");<br />

System.out.println("Successful getQueueTable");<br />

/* Get a handle to a queue - aq_queue1 in aqjava schema: */<br />

queue = aq_sess.getQueue ("aqjava", "aq_queue1");<br />

System.out.println("Successful getQueue");<br />

A-8 <strong>Oracle</strong>9i Application Developer’s Guide - <strong>Advanced</strong> <strong>Queuing</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!