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.

General Features of <strong>Advanced</strong> <strong>Queuing</strong><br />

XMLType Queue Payloads<br />

{<br />

Connection db_conn = null;<br />

try<br />

{<br />

Class.forName("oracle.jdbc.driver.<strong>Oracle</strong>Driver");<br />

/* your actual hostname, port number, and SID will<br />

vary from what follows. Here we use 'dlsun736,' '5521,'<br />

and 'test,' respectively: */<br />

db_conn =<br />

DriverManager.getConnection(<br />

"jdbc:oracle:thin:@dlsun736:5521:test",<br />

user, passwd);<br />

System.out.println("JDBC Connection opened ");<br />

db_conn.setAutoCommit(false);<br />

/* Load the <strong>Oracle</strong>8i AQ driver: */<br />

Class.forName("oracle.AQ.AQ<strong>Oracle</strong>Driver");<br />

System.out.println("Successfully loaded AQ driver ");<br />

}<br />

catch (Exception ex)<br />

{<br />

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

ex.printStackTrace();<br />

}<br />

return db_conn;<br />

You can create queues with XMLType payloads. These can be used for transmitting<br />

and storing messages that contain XML documents. By defining <strong>Oracle</strong> objects with<br />

XMLType attributes, you can do the following:<br />

Store more than one type of XML document in the same queue. The documents<br />

<br />

are stored internally as CLOBs.<br />

Selectively dequeue messages with XMLType attributes using the operators<br />

<br />

XMLType.existsNode(), XMLType.extract(), and so on.<br />

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