|Oracle9i Application Developer's Guide - Advanced Queuing
Release 1 (9.0.1)
Part Number A88890-02
AQ Programmatic Environments, 6 of 9
Java AQ API supports both the administrative and operational features of Oracle AQ (Advanced Queueing). In developing Java programs for messaging applications, you will use JDBC to open a connection to the database and then the oracle.AQ, the Java AQ API for message queuing. This means that you will no longer need to use PL/SQL interfaces.
Oracle9i Supplied Java Packages Reference describes the common interfaces and classes based on current PL/SQL interfaces.
The Java AQ classes are located in
jar. These classes can be used with any Oracle8i JDBC driver.
jarfiles into the database using the "loadjava" utility.
Appendix A, "Oracle Advanced Queuing by Example" contains the following examples:
The various implementations of the Java AQ API are managed via an
AQDriverManager. Both OLite and Oracle9i will have an
AQDriver that is registered with the
AQDriverManager. The driver manager is used to create an
AQSession that can be used to perform messaging tasks.
The Oracle8i AQ driver is registered using the Class.forName ("oracle.AQ.AQOracleDriver") command.
createAQSession() method is invoked, it calls the appropriate
AQDriver (amongst the registered drivers) depending on the parameter passed to the
AQDriver expects a valid JDBC connection to be passed in as a parameter to create an AQSession. Users must have the execute privilege on the
DBMS_AQIN package to use the AQ Java interfaces. Users can also acquire these rights through the
AQ_USER_ROLE or the
AQ_ADMINSTRATOR_ROLE. Users will also need the appropriate system and queue privileges for 8.1-style queue tables.