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.

Enqueue Features<br />

}<br />

try<br />

{<br />

/* Create an AQ Session: */<br />

aq_sess = AQDriverManager.createAQSession(db_conn);<br />

/* Create a priority queue table for OE */<br />

mqt_prop = new AQQueueTableProperty("BOLADM.order_typ");<br />

mqt_prop.setComment("Order Entry Priority " +<br />

"MultiConsumer Orders queue table");<br />

mqt_prop.setCompatible("8.1");<br />

mqt_prop.setMultiConsumer(true);<br />

mqt_prop.setSortOrder("priority,enq_time");<br />

pr_mq_table = aq_sess.createQueueTable("OE", "OE_orders_pr_mqtab",<br />

mqt_prop);<br />

/* Create a Queue in this queue table */<br />

q_prop = new AQQueueProperty();<br />

bookedorders_q = aq_sess.createQueue(pr_mq_table,<br />

"OE_bookedorders_que", q_prop);<br />

/* Enable enqueue and dequeue on the queue */<br />

bookedorders_q.start(true, true);<br />

}<br />

catch (AQException ex)<br />

{<br />

System.out.println("AQ Exception: " + ex);<br />

}<br />

/* When an order arrives, the order entry application can use the following<br />

procedure to enqueue the order into its booked orders queue. A shipping<br />

priority is specified for each order<br />

*/<br />

public static void order_enqueue(Connection db_conn, String book_title,<br />

double book_qty, double order_num,<br />

int ship_priority, String cust_state,<br />

String cust_country, String cust_region,<br />

String cust_order_type)<br />

8-42 <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!