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 />

set oraaq = OraDatabase.CreateAQ("OE.OE_bookedorders_que")<br />

Set OraMsg = OraAq.AQMsg(ORATYPE_OBJECT, "BOLADM.order_typ")<br />

Set OraOrder = OraDatabase.CreateOraObject("BOLADM.order_typ")<br />

Set OraCust = OraDatabase.CreateOraObject("BOLADM.Customer_typ")<br />

Set OraBook = OraDatabase.CreateOraObject("BOLADM.book_typ")<br />

Set OraItem = OraDatabase.CreateOraObject("BOLADM.orderitem_typ")<br />

Set OraItemList = OraDatabase.CreateOraObject("BOLADM.orderitemlist_vartyp")<br />

' Get the values of cust_state,cust_country etc from user(form_based<br />

' input) and then a cmd_click event for Enqueue<br />

' will execute the subroutine order_enq.<br />

Private Sub Order_enq()<br />

OraMsg.correlation = txt_correlation<br />

'Initialize the customer details<br />

OraCust("state") = txt_cust_state<br />

OraCust("country") = txt_cust_country<br />

OraBook("title") = txt_book_title<br />

OraItem("quantity") = txt_book_qty<br />

OraItem("item") = OraBook<br />

OraItemList(1) = OraItem<br />

OraOrder("orderno") = txt_order_num<br />

OraOrder("ordertype") = txt_cust_order_typ<br />

OraOrder("orderregion") = cust_region<br />

OraOrder("customer") = OraCust<br />

OraOrder("items") = OraItemList<br />

'Put the shipping priority into message property before enqueuing<br />

' the message:<br />

OraMsg.priority = priority<br />

OraMsg = OraOrder<br />

Msgid = OraAq.enqueue<br />

'Release all allocations<br />

End Sub<br />

Java (JDBC): Example Code<br />

public static void createPriorityQueueTable(Connection db_conn)<br />

{<br />

AQSession aq_sess;<br />

AQQueueTableProperty mqt_prop;<br />

AQQueueTable pr_mq_table;<br />

AQQueueProperty q_prop;<br />

AQQueue bookedorders_q;<br />

A Sample Application Using AQ 8-41

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

Saved successfully!

Ooh no, something went wrong!