Oracle8i Application Developer's Guide - Advanced Queuing
Release 8.1.5

A68005-01

Library

Product

Contents

Index

Prev Next

7
Advanced Queuing -- Java API

This chapter introduces and details the Java Application Programmer's Interface for Advanced Queuing under the following headings:


Introduction

The Java AQ API supports both the administrative and operational features of Oracle AQ. In developing Java programs for messaging applications, you will use JDBC to open a connection to the database and then the Java AQ API for message queuing. This means that you will no longer be required to use the PL/SQL interfaces.

The following sections describe the common interfaces and classes based on the current PL/SQL interfaces. The common interfaces are prefixed with "AQ". These interfaces will have different implementations in Oracle8i and Oracle Lite. In this document we describe the common interfaces and their corresponding Oracle8i implementations, which are in turn prefixed with "AQOracle".

The java AQ classes are located in $ORACLE_HOME/rdbms/jlib/aqapi.jar. These classes can be used with any Oracle8i JDBC driver. If your application uses the OCI8 or thin JDBC driver, you must include $ORACLE_HOME/rdbms/jlib/aqapi.jar in the CLASSPATH. If the application is using the KPRB driver and accessing the java AQ API from java stored procedures, you must first load the aqapi.jar file into the database using the "loadjava" utility.

Chapter 8, "Oracle Advanced Queuing by Example" contains the following examples:

Set up for the test_aqjava class is described in "Setup for AQ Examples".

The way to create a multi-consumer queue is described in the "AQSession".


AQDriverManager

The various implementations of the Java AQ API are managed via an AQDriverManager. Both OLite and Oracle8i will have an AQDriver which is registered with the AQDriverManager. The driver manager is used to create an AQSession which can be used to perform messaging tasks.

When the AQDriverManager.createAQSession() method is invoked, it calls the appropriate AQDriver (amongst the registered drivers) depending on the parameter passed to the createAQSession() call.

The Oracle8i 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 in order 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.


Note:

Currently the Oracle8i AQDriver supports only RAW type payloads.  



getDrivers

Purpose:

This method returns the list of drivers registered with the driver manager. It returns a Vector of strings containing the names of the registered drivers.

Syntax:

public static java.util.Vector getDrivers()


getAQSession

Purpose:

This method creates an AQSession.

Syntax:

public static AQSession getAQSession (java.lang.Object conn) throws AQException

Table 7-1 getAQSession Parameters
Parameter  Meaning 

conn  

if the user is using the AQOracleDriver , then the object passed in must be a valid JDBC connection  

Multithreaded Program Support

Currently Java AQ objects are not thread safe. Therefore, methods on AQSession, AQQueueTable, AQQueue and other AQ objects should not be called concurrently from different threads. You can pass these objects between threads, but the program must ensure that the methods on these AQ objects are not invoked concurrently.

We recommend that multithreaded programs create a different AQSession in each thread (using the same or a different JDBC connection) and get new queue table and queue handles using the getQueueTable and getQueue methods in AQSession.


registerDriver

Purpose:

This method is used by various implementations of the AQ driver to register themselves with the driver manager (this method is not directly called by client programs)

Syntax:

public static void registerDriver(AQDriver aq_driver)


Note:

To create an AQSession, you must first open a JDBC connection. Then you must load the AQDriver that you need to use in the application. Note that the driver needs to be loaded only once (before the first createAQSession call). Loading the driver multiple times will have no effect. For more information, see "Setup for AQ Examples".  


Example

Connection db_conn;       /* JDBC connection */
AQSession   aq_sess;       /* AQSession */

/* JDBC setup and connection creation: */
class.forName("oracle.jdbc.driver.OracleDriver");
db_conn = DriverManager.getConnection (
   "jdbc:oracle:oci8:@", "aquser", "aquser");
db_conn.setAutoCommit(false);

/* Load the Oracle8i AQ driver: */
class.forName("oracle.AQ.AQOracleDriver");
/* Create an AQ Session: */
aq_sess = AQDriverManager.createAQSession(db_conn);

APIs/Classes

Table 7-2 AQ Interfaces
Interface Summary  Description 

AQSession  

Open a session to the queuing system  

AQQueueTable  

AQ Queue Table interface  

AQQueueAdmin  

AQ Queue administrative interfaces  

AQQueue  

AQ Queue operational interfaces  

AQMessage  

AQ message  

AQRaw Payload  

AQ Raw Payload  

AQDriver  

Interface for various AQ drivers  

Table 7-3 AQ Common Classes
Class Summary  Description 

AQConstants  

Constants used in AQ operations  

AQAgent  

AQ Agent  

AQDriverManager  

Driver Manager for various AQ drivers  

AQEnqueueOption  

AQ Enqueue Options  

AQDequeueOption  

AQ Dequeue options  

AQMessageProperty  

AQ Message properties  

AQQueueProperty  

AQ Queue properties  

AQQueueTableProperty  

AQ Queue Table properties  

Table 7-4 Oracle8i AQ Classes
Class Summary  Description 

AQOracleSession  

Oracle server implementation of AQSession  

AQOracleMessage  

Oracle Server implementation of AQMessage  

AQOracleDriver  

Oracle server implementation of AQDriver  

AQOracleQueue  

Oracle server implementation of AQQueue  

AQOracleQueueTable  

Oracle server implementation of AQQueueTable  

AQOracleRawPayload  

Oracle server implementation of AQRawPayload  

In general use only the interfaces and classes that are common to both implementations (as described in the first two tables). This will ensure that your applications are portable between Oracle 8i and Olite AQ implementations.

The AQOracle classes should not be used unless there is a method in these classes that is not available in the common interfaces.

Note that since the AQQueue interface extends AQQueueAdmin, all queue administrative and operation functionality is available via AQQueue.


AQSession


createQueueTable

Purpose:

This method creates a new queue table in a particular user's schema according to the properties specified in the AQQueueTableProperty object passed in.

Syntax:

public AQQueueTable createQueueTable(java.lang.String owner,
                                     java.lang.String name, 
                                     AQQueueTableProperty property) 
                                     throws AQException

Table 7-5 createQueueTable Parameters
Parameter  Meaning 

owner  

schema (user) in which to create the queue table  

q_name  

name of the queue table  

property  

queue table properties  

Returns:

AQQueueTable object


getQueueTable

Purpose:

This method is used to get a handle to an existing queue table.

Syntax:

public AQQueueTable getQueueTable(java.lang.String owner, 
                                  java.lang.String name)
  
Table 7-6 getQueueTable Parameters
Parameter  Meaning 

owner  

schema (user) in which the queue table resides  

name  

name of the queue table  

Returns:

AQQueueTable object


createQueue

Purpose:

This method creates a queue in a queue_table with the specified queue properties. It uses the same schema name that was used to create the queue table.

Syntax:

public AQQueue createQueue(AQQueueTable q_table,
                           java.lang.String q_name,
                           AQQueueProperty q_property) throws AQException

Table 7-7 createQueue Parameters
Parameter  Meaning 

q_table  

queue table in which to create queue  

name  

name of the queue to be created  

q_property  

queue properties  

Returns:

AQQueue object


getQueue

Purpose:

This method can be used to get a handle to an existing queue.

Syntax:

public AQQueue getQueue(java.lang.String owner,
                        java.lang.String name)
 
Table 7-8 getQueue Parameters
Parameter  Meaning 

owner  

schema (user) in which the queue table resides  

name  

name of the queue  

Returns:

AQQueue object

Usage Note

Currently the java AQ API supports only queues with raw payloads. If you try to access queue tables that contain queues with object payloads you will get an AQException with the message "payload type not supported."

Setup for AQ Examples

1. Create an AQ User

Here an 'aqjava' user is setup as follows:

CONNECT sys/change_on_install AS sysdba

DROP USER aqjava CASCADE;
GRANT CONNECT, RESOURCE, AQ_ADMINISTRATOR_ROLE TO aqjava IDENTIFIED BY aqjava;
GRANT EXECUTE ON SYS.DBMS_AQADM TO aqjava;
GRANT EXECUTE ON SYS.DBMS_AQ TO aqjava;
CONNECT aqjava/aqjava

2. Set up main class

Next we set up the main class from which we will call subsequent examples and handle exceptions.

import java.sql.*;
import oracle.AQ.*;

public class test_aqjava
{
   public static void main(String args[]) 
   {
      AQSession  aq_sess = null;

      try 
      {
         aq_sess = createSession(args);

        /* now run the test: */
        runTest(aq_sess);     
      }
      catch (Exception ex)
      {
         System.out.println("Exception-1: " + ex); 
         ex.printStackTrace();      
      }  
   }
}

3. Create an AQ Session;

Next,  an AQ Session is created for the 'aqjava' user as shown in the 
AQDriverManager section above:
 public static AQSession createSession(String args[]) 
   {
      Connection db_conn;
      AQSession  aq_sess = null;

      try 
      {
    
         Class.forName("oracle.jdbc.driver.OracleDriver");
         /* your actual hostname, port number, and SID will 
         vary from what follows. Here we use 'dlsun736,' '5521,'
         and 'test,' respectively: */

         db_conn =
                  DriverManager.getConnection(
                  "jdbc:oracle:thin:@dlsun736:5521:test", 
                  "aqjava", "aqjava");

         System.out.println("JDBC Connection opened "); 
         db_conn.setAutoCommit(false);
                 
         /* Load the Oracle8i AQ driver: */
         Class.forName("oracle.AQ.AQOracleDriver");

         /* Create an AQ Session: */
         aq_sess = AQDriverManager.createAQSession(db_conn);
         System.out.println("Successfully created AQSession ");  
      }
      catch (Exception ex)
      {
         System.out.println("Exception: " + ex); 
         ex.printStackTrace();      
      }  
      return aq_sess;
   }


Example

1. Create a queue table and a queue

Now, with the ' runTest' class, called from the above main class, we will create a queue table and queue for the 'aqjava' user.

public static void runTest(AQSession aq_sess) throws AQException
{
    AQQueueTableProperty     qtable_prop;
    AQQueueProperty          queue_prop;
    AQQueueTable             q_table;
    AQQueue                  queue;
   
    /* Create a AQQueueTableProperty object (payload type - RAW): */
    qtable_prop = new AQQueueTableProperty("RAW"); 
   
    /* Create a queue table called aq_table1 in aqjava schema: */
    q_table = aq_sess.createQueueTable ("aqjava", "aq_table1", qtable_prop);
    System.out.println("Successfully created aq_table1 in aqjava schema");  

    /* Create a new AQQueueProperty object: */
    queue_prop = new AQQueueProperty();
   
    /* Create a queue called aq_queue1 in aq_table1: */
    queue = aq_sess.createQueue (q_table, "aq_queue1", queue_prop);
    System.out.println("Successfully created aq_queue1 in aq_table1");  
}

2. Get a handle to an existing queue table and queue

public static void runTest(AQSession aq_sess) throws AQException
{
    AQQueueTable            q_table;
    AQQueue                 queue;
    
    /* Get a handle to queue table - aq_table1 in aqjava schema: */
    q_table = aq_sess.getQueueTable ("aqjava", "aq_table1");
    System.out.println("Successful getQueueTable");  
    
    /* Get a handle to a queue - aq_queue1 in aqjava schema: */
    queue = aq_sess.getQueue ("aqjava", "aq_queue1");
    System.out.println("Successful getQueue");  
}


AQConstants

This class contains some constants used in the java AQ API .

Visibility constants

VISIBILITY_IMMEDIATE
public static final int VISIBILITY_IMMEDIATE

VISIBILITY_ONCOMMIT
public static final int VISIBILITY_ONCOMMIT

Payload type

RAW_TYPE_PAYLOAD
public static final int RAW_TYPE_PAYLOAD


AQAgent

This object specifies the producer or a consumer of a message.


Constructor

Purpose:

There are two implementations of the constructor, each of which allocates a new AQAgent with the specified parameters.

Syntax:

public AQAgent(java.lang.String name,
               java.lang.String address,
               double protocol)

public AQAgent(java.lang.String name,
               java.lang.String address)

Table 7-9 AQAgent Parameters
Parameter  Meaning 

name  

agent name  

address  

agent address  

protocol  

agent protocol (required only in the first constructor); default is 0  


getName

Purpose:

This method gets the agent name.

Syntax:

public java.lang.String getName() throws AQException


setName

Purpose:

This method sets the agent name.

Syntax:

public void setName(java.lang.String name) throws AQException

Table 7-10 setName Parameters
Parameter  Meaning 

name  

Agent name  


getAddress

Purpose:

This method gets the agent address.

Syntax:

public java.lang.String getAddress() throws AQException


setAddress

Purpose:

This method sets the agent address.

Syntax:

public void setAddress(java.lang.String address) throws AQException

Table 7-11 setAddress Parameters
Parameter  Meaning 

address  

queue at a specific destination  


getProtocol

Purpose:

This method gets the agent protocol.

Syntax:

public int getProtocol() throws AQException


setProtocol

Purpose:

This method sets the agent protocol.

Syntax:

public void setProtocol(int protocol) throws AQException

Table 7-12 setProtocol Parameters
Parameter  Meaning 

protocol  

Agent protocol  


AQQueueTableProperty

This class represents queue table properties.


Constants for Message Grouping

public static final int NONE
public static final int TRANSACTIONAL


Constructor

Purpose:

This method creates an AQQueueTableProperty object with default property values and the specified payload type.

Syntax:

public AQQueueTableProperty(java.lang.String p_type)

Table 7-13 AQQueueTableProperty Parameters
Parameter  Meaning 

p_type  

payload type: this is "RAW" for queue tables that will contain raw payloads or the object type for queue tables that will contain structured payloads  


Note:

Currently only payloads of RAW type are supported.  



getPayloadType

Purpose:

This method returns "RAW" for raw payloads or the object type for object payloads.

Syntax:

public java.lang.String getPayloadType() throws AQException


setPayloadType

Purpose:

This method is used to set the payload type.

Syntax:

public void setPayloadType(java.lang.String p_type) throws AQException

Table 7-14 setPayloadType Parameters
Parameter  Meaning 

p_type  

payload type: this is "RAW" for queue tables that will contain raw payloads or the object type for queue tables that will contain structured payloads  


setStorageClause

Purpose:

This method is used to set the storage clause to be used to create the queue table.

Syntax:

public void setStorageClause(java.lang.String s_clause) throws AQException

Table 7-15 setStorageClause Parameters
Parameter  Meaning 

s_clauses  

storage parameter: this clause is used in the `CREATE TABLE' statement when the queue table is created  


getSortOrder

Purpose:

This method gets the sort order that is used.

Syntax:

public java.lang.String getSortOrder() throws AQException

Returns:

The sort order used


setSortOrder

Purpose:

This method sets the sort order to be used.

Syntax:

public void setSortOrder(java.lang.String s_order) throws AQException

Table 7-16 setSortOrder Parameters
Parameter  Meaning 

s_order  

specifies the columns to be used as the sort_key in ascending order; the string has the format <sort_column1, sort_column2>; the allowed columns name are priority and enq_time.  


isMulticonsumerEnabled

Purpose:

This method queries whether the queues created in the table can have multiple consumers per message or not.

Syntax:

public boolean isMulticonsumerEnabled() throws AQException

Returns:

TRUE if the queues created in the table can have multiple consumers per message.

FALSE if the queues created in the table can have only one consumer per message.


setMultiConsumer

Purpose:

This method determines whether the queues created in the table can have multiple consumers per message or not.

Syntax:

public void setMultiConsumer(boolean enable) throws AQException

Table 7-17 setMultiConsumer Parameters
Parameter  Meaning 

enable  

FALSE if the queues created in the table can have only one consumer per message

TRUE if the queues created in the table can have multiple consumers per message  


getMessageGrouping

Purpose:

This method is used to get the message grouping behavior for the queues in this queue table.

Syntax:

public int getMessageGrouping() throws AQException

Returns:

NONE: each message is treated individually

TRANSACTIONAL: all messages enqueued as part of one transaction are considered part of the same group and can be dequeued as a group of related messages.


setMessageGrouping

Purpose:

This method is used to set the message grouping behavior for queues created in this queue table.

Syntax:

public void setMessageGrouping(int m_grouping) throws AQException

Table 7-18 setMessageGrouping Parameters
Parameter  Meaning 

m_grouping  

NONE or TRANSACTIONAL  


getComment

Purpose:

This method gets the queue table comment.

Syntax:

public java.lang.String getComment() throws AQException


setComment

Purpose:

This method sets a comment.

Syntax:

public void setComment(java.lang.String qt_comment) throws AQException

Table 7-19 setComment Parameters
Parameter  Meaning 

qt_comment  

comment  


getCompatible

Purpose:

This method gets the compatible property.

Syntax:

public java.lang.String getCompatible() throws AQException


setCompatible

Purpose:

This method sets the compatible property.

Syntax:

public void setCompatible(java.lang.String qt_compatible) throws AQException

Table 7-20 setCompatible Parameters
Parameter  Meaning 

qt_compatible  

compatible property  


getPrimaryInstance

Purpose:

This method gets the primary instance.

Syntax:

public int getPrimaryInstance() throws AQException


setPrimaryInstance

Purpose:

This method sets the primary instance.

Syntax:

public void setPrimaryInstance(int inst) throws AQException

Table 7-21 setPrimaryInstance Parameters
Parameter  Meaning 

inst  

primary instance  

getSecondaryInstance

Purpose:

This method gets the secondary instance.

Syntax:

public int getSecondaryInstance() throws AQException


setSecondaryInstance

Purpose:

This method sets the secondary instance.

Syntax:

public void setSecondaryInstance(int inst) throws AQException

Table 7-22 setSecondaryInstance Parameters
Parameter  Meaning 

inst  

secondary instance  


Examples:

Set up the test_aqjava class as described in "Setup for AQ Examples".

1. Create a queue table property object with raw payload type

public static void runTest(AQSession aq_sess) throws AQException
 {
     AQQueueTableProperty qtable_prop;

     /* Create AQQueueTable Property object: */
     qtable_prop = new AQQueueTableProperty("RAW");
     qtable_prop.setSortOrder("PRIORITY");
}

2. Create a queue table property object with raw payload type (for 8.1 style queues)

 public static void runTest(AQSession aq_sess) throws AQException
 {
     AQQueueTableProperty qtable_prop;

     /* Create AQQueueTable Property object: */
     qtable_prop = new AQQueueTableProperty("RAW");
     qtable_prop.setComment("Qtable with raw payload");
     qtable_prop.setCompatible("8.1");
}

AQQueueProperty

This class represents queue properties.


Constants:

public static final int NORMAL_QUEUE
public static final int EXCEPTION_QUEUE
public static final int INFINITE   /* infinite retention */


Constructor:

Purpose:

This method creates a new AQQueueProperty object with default property values.

Syntax:

public AQQueueProperty()


getQueueType

Purpose:

This method gets the queue type .

Syntax:

public int getQueueType() throws AQException

Returns:

NORMAL_QUEUE or EXCEPTION_QUEUE


setQueueType

Purpose:

This method is used to set the queue type.

Syntax:

public void setQueueType(int q_type) throws AQException

Table 7-23 setQueueType Parameters
Parameter  Meaning 

q_type  

NORMAL_QUEUE or EXCEPTION_QUEUE  


getMaxRetries

Purpose:

This method gets the maximum retries for dequeue with REMOVE mode.

Syntax:

public int getMaxRetries() throws AQException


setMaxRetries

Purpose:

This method sets the maximum retries for dequeue with REMOVE mode.

Syntax:

public void setMaxRetries(int retries) throws AQException
public void setMaxRetries(Integer retries) throws AQException

Table 7-24 setMaxRetries Parameters
Parameter  Meaning 

retries  

maximum retries for dequeue with REMOVE mode; specifying NULL will use the default. The default applies to single consumer queues and 8.1. compatible multiconsumer queues. Max_retries is not supported for 8.0 compatible multiconsumer queues.  


setRetryInterval

Purpose:

This method sets the retry interval, that is the time before this message is scheduled for processing after an application rollback. Default is 0.

Syntax:

public void setRetryInterval(double interval) throws AQException
public void setRetryInterval(Double interval) throws AQException

Table 7-25 setRetryInterval Parameters
Parameter  Meaning 

interval  

retry interval; specifying NULL will use the default  


getRetryInterval

Purpose:

This method gets the retry interval.

Syntax:

public double getRetryInterval() throws AQException


getRetentionTime

Purpose:

This method gets the retention time.

Syntax:

public double getRetentionTime() throws AQException


setRetentionTime

Purpose:

This method gets the retention time.

Syntax:

public void setRetentionTime(double r_time) throws AQException
public void setRetentionTime(Double r_time) throws AQException

Table 7-26 setRetentionTime Parameters
Parameter  Meaning 

r_time  

retention time; specifying NULL will use the default  


getComment

Purpose:

This method gets the queue comment.

Syntax:

public java.lang.String getComment() throws AQException


setComment

Purpose:

This method sets the queue comment.

Syntax:

public void setComment(java.lang.String qt_comment) throws AQException

Table 7-27 setComment Parameters
Parameter  Meaning 

qt_comment  

queue comment  


Example:

Set up the test_aqjava class as described in Setup for AQ Examples.

Create a AQQueueProperty object

 {
     AQQueueProperty         q_prop;
     q_prop = new AQQueueProperty();
     q_prop.setRetentionTime(15); /* set retention time */
     q_prop.setRetryInterval(30); /* set retry interval  */
}


AQQueueTable

The AQQueueTable interface contains methods for queue table administration.


getOwner

Purpose:

This method gets the queue table owner.

Syntax:

public java.lang.String getOwner() throws AQException


getName

Purpose:

This method gets the queue table name.

Syntax:

public java.lang.String getName() throws AQException


getProperty

Purpose:

This method gets the queue table properties.

Syntax:

public AQQueueTableProperty getProperty() throws AQException

Returns:

AQQueueTableProperty object


drop

Purpose:

This method drops the current queue table.

Syntax:

public void drop(boolean force) throws AQException

Table 7-28 drop Parameters
Parameter  Meaning 

force  

FALSE: this operation will not succeed if there are any queues in the queue table (the default)

TRUE : all queues in the queue table are stopped and dropped automatically  


alter

Purpose:

This method is used to alter queue table properties.

Syntax:

public void alter(java.lang.String comment,
                  int primary_instance, 
                  int secondary_instance) throws AQException

public void alter(java.lang.String comment) throws AQException

Table 7-29 alter Parameters
Parameter  Meaning 

comment  

new comment  

primary_instance  

new value for primary instance  

secondary_instance  

new value for secondary instance  


createQueue

Purpose:

This method is used to create a queue in this queue table.

Syntax:

public AQQueue createQueue(java.lang.String queue_name,
                           AQQueueProperty q_property) throws AQException

Table 7-30 createQueue Parameters
Parameter  Meaning 

queue_name  

name of the queue to be created  

q_property  

queue properties  

Returns:

AQQueue object


dropQueue

Purpose:

This method is used to drop a queue in this queue table.

Syntax:

public void dropQueue(java.lang.String queue_name) throws AQException

Table 7-31 dropQueue Parameters
Parameter  Meaning 

queue_name  

name of the queue to be dropped  


Example:

Set up the test_aqjava class as described in Setup for AQ Examples.

1. Create a queue table and a queue

public static void runTest(AQSession aq_sess) throws AQException
{
   AQQueueTableProperty    qtable_prop;
   AQQueueProperty         queue_prop;
   AQQueueTable            q_table;
   AQQueue                 queue;

   /* Create a AQQueueTable property object (payload type - RAW): */
   qtable_prop = new AQQueueTableProperty("RAW"); 
 
   /* Create a queue table called aq_table2 in aquser schema: */
   qtable = aq_sess.createQueueTable ("aquser", "aq_table2", qtable_prop);
   System.out.println("Successfully createQueueTable");  

   /* Create a new AQQueueProperty object: */
   queue_prop = new AQQueueProperty();

   /* Create a queue called aq_queue2 in aq_table2: */
   queue = qtable.createQueue ("aq_queue2", queue_prop);
   System.out.println("Successful createQueue");  
}

2. Alter queue table, get properties and drop the queue table

{
     AQQueueTableProperty    qtable_prop;
     AQQueueTable            q_table;
     
     /* Get a handle to the queue table called aq_table2 in aquser schema: */
     q_table = aq_sess.getQueueTable ("aqjava", "aq_table2");
     System.out.println("Successful getQueueTable");  

     /* Get queue table properties: */
     qtable_prop = q_table.getProperty();

     /* Alter the queue table: */
     q_table.alter("altered queue table");
     
     /* Drop the queue table (and automatically drop queues inside it): */
     q_table.drop(true);
     System.out.println("Successful drop"); 
} 


Note:

Queues can be created via the AQSession.createQueue or the AQQueueTable.createQueue interfaces. The former expects an AQQueueTable object as a parameter in addition to the queue_name and queue properties.  




AQQueueAdmin


start

Purpose:

This method is used to enable enqueue and dequeue on this queue.

Syntax:

public void start(boolean enqueue,
                  boolean dequeue) throws AQException

Table 7-32 start Parameters
Parameter  Meaning 

enqueue  

TRUE -- enable enqueue on this queue

FALSE -- leave current setting unchanged  

dequeue  

TRUE -- enable dequeue on this queue

FALSE -- leave current setting unchanged  


startEnqueue

Purpose:

This method is used to enable enqueue on this queue . This is equivalent to start(TRUE, FALSE)

Syntax:

public void startEnqueue() throws AQException


startDequeue

Purpose:

This method is used to enable dequeue on this queue. This is equivalent to start(FALSE, TRUE).

Syntax:

public void startDequeue() throws AQException


stop

Purpose:

This method is used to disable enqueue/dequeue on this queue.

Syntax:

public void stop(boolean enqueue,
                 boolean dequeue,
                 boolean wait) throws AQException

Table 7-33 stop Parameters
Parameter  Meaning 

enqueue  

TRUE -- disable enqueue on this queue

FALSE -- leave current setting unchanged  

dequeue  

TRUE -- disable dequeue on this queue

FALSE -- leave current setting unchanged  

wait  

TRUE -- wait for outstanding transactions to complete

FALSE -- return immediately either with a success or an error  


stopEnqueue

Purpose:

This method is used to disable enqueue on a queue. This is equivalent to stop(TRUE, FALSE, wait).

Syntax:

public void stopEnqueue(boolean wait) throws AQException

Table 7-34 stopEnqueue Parameters
Parameter  Meaning 

wait  

TRUE -- wait for outstanding transactions to complete

FALSE -- return immediately either with a success or an error  


stopDequeue

Purpose:

This method is used to disable dequeue on a queue. This is equivalent to stop(FALSE, TRUE, wait).

Syntax:

public void stopDequeue(boolean wait) throws AQException

Table 7-35 stopDequeue Parameters
Parameter  Meaning 

wait  

TRUE -- wait for outstanding transactions to complete

FALSE -- return immediately either with a success or an error  


drop

Purpose:

This method is used to drop a queue

Syntax:

public void drop() throws AQException


alterQueue

Purpose:

This method is used to alter queue properties

Syntax:

public void alterQueue(AQQueueProperty property) throws AQException

Table 7-36 alterQueue Parameters
Parameter  Meaning 

property  

AQQueueProperty object with new property values. Note that only max_retries, retry_delay, retention_time and comment can be altered.  


addSubscriber

Purpose:

This method is used to add a subscriber for this queue.

Syntax:

public void addSubscriber(AQAgent subscriber,
                          java.lang.String rule) throws AQException

Table 7-37 addSubscriber Parameters
Parameter  Meaning 

subscriber  

the AQAgent on whose behalf the subscription is being defined  

rule  

a conditional expression based on message properties, and the message data properties  


removeSubscriber

Purpose:

This method removes a subscriber from a queue.

Syntax:

public void removeSubscriber(AQAgent subscriber) throws AQException

Table 7-38 removeSubscriber Parameters
Parameter  Meaning 

subscriber  

the AQAgent to be removed  


alterSubscriber

Purpose:

This method alters properties for a subscriber to a queue.

Syntax:

public void alterSubscriber(AQAgent subscriber,
                            java.lang.String rule) throws AQException

Table 7-39 alterSubscriber Parameters
Parameter  Meaning 

subscriber  

the AQAgent whose subscription is being altered  

rule  

a conditional expression based on message properties, the message data properties  


grantQueuePrivilege

Purpose:

This method is used to grant queue privileges to users and roles. The method has been overloaded. The second implementation is equivalent to to calling the first imeplementation with grant_option = FALSE .

Syntax:

public void grantQueuePrivilege(java.lang.String privilege,
                                java.lang.String grantee, 
                                boolean grant_option) throws AQException

public void grantQueuePrivilege(java.lang.String privilege,
                                java.lang.String grantee) throws AQException

Table 7-40 grantQueuePrivilege Parameters
Parameter  Meaning 

privilege  

specifies the privilege to be granted: ENQUEUE, DEQUEUE or ALL  

grantee  

specifies the grantee(s); the grantee(s) can be a user, a role or the PUBLIC roles  

grant_option  

TRUE -- the grantee is allowed to use this method to grant access to others

FALSE -- default  


revokeQueuePrivilege

Purpose:

This method is used to revoke a queue privilege.

Syntax:

public void revokeQueuePrivilege(java.lang.String privilege,
                                 java.lang.String grantee) throws AQException

Table 7-41 revokeQueuePrivilege Parameters
Parameter  Meaning 

privilege  

specifies the privilege to be revoked: ENQUEUE, DEQUEUE or ALL  

grantee  

specifies the grantee(s); the grantee(s) can be a user, a role or the PUBLIC roles  


schedulePropagation

Purpose:

This method is used to schedule propagation from a queue to a destination identified by a database link.

Syntax:

public void schedulePropagation(java.lang.String destination,
                                java.util.Date start_time,
                                java.lang.Double duration,
                                java.lang.String next_time,
                                java.lang.Double latency) throws AQException

Table 7-42 schedulePropagation Parameters
Parameter  Meaning 

destination  

specifies the destination database link. Messages in the source queue for recipients at the destination will be propagated. NULL => destination is the local database and messages will be propagated to all other queues in the local database. Maximum length for this field is 128 bytes. If the name is not fully qualified, the default domain name is used.  

start_time  

specifies the initial start time for the propagation window for messages from this queue to the destination. NULL => start time is current time.  

duration  

specifies the duration of the propagation window in seconds. NULL => propagation window is forever or until propagation is unscheduled  

next_time  

date function to compute the start of the next propagation window from the end of the current window. (e.g use "SYSDATE+ 1 - duration/86400" to start the window at the same time everyday. NULL => propagation will be stopped at the end of the current window  

latency  

maximum wait, in seconds, in the propagation window for the message to be propagated after it is enqueued. NULL => use default value (60 seconds)  


unschedulePropagation

Purpose:

This method is used to unschedule a previously scheduled propagation of messages from the current queue to a destination identfied by a specific database link..

Syntax:

public void unschedulePropagation(java.lang.String destination) 
                                  throws AQException

Table 7-43 unschedulePropagation Parameters
Parameter  Meaning 

destination  

specifies the destination database link. NULL => destination is the local database.  


alterPropagationSchedule

Purpose:

This method is used to alter a propagation schedule.

Syntax:

public void alterPropagationSchedule(java.lang.String destination,
                                     java.lang.Double duration,
                                     java.lang.String next_time,
                                     java.lang.Double latency)throws AQException

Table 7-44 alterPropagationSchedule Parameters
Parameter  Meaning 

destination  

specifies the destination database link. NULL => destination is the local database.  

duration  

specifies the duration of the propagation window in seconds. NULL => propagation window is forever or until propagation is unscheduled  

next_time  

date function to compute the start of the next propagation window from the end of the current window. (e.g use "SYSDATE+ 1 - duration/86400" to start the window at the same time everyday. NULL => propagation will be stopped at the end of the current window  

latency  

maximum wait, in seconds, in the propagation window for the message to be propagated after it is enqueued. NULL => use default value (60 seconds)  


enablePropagationSchedule

Purpose:

This method is used to enable a propagation schedule.

Syntax:

public void enablePropagationSchedule(java.lang.String destination) 
                                      throws AQException

Table 7-45 enablePropagationSchedule Parameters
Parameter  Meaning 

destination  

specifies the destination database link. NULL => destination is the local database.  



disablePropagationSchedule

Purpose:

This method is used to disable a propagation schedule.

Syntax:

public void disablePropagationSchedule(java.lang.String destination) 
                                       throws AQException

Table 7-46 disablePropagationSchedule Parameters
Parameter  Meaning 

destination  

specifies the destination database link. NULL => destination is the local database.  


Examples:

Set up the test_aqjava class. For more information, see "Setup for AQ Examples"

1. Create a queue and start enqueue/dequeue

{
     AQQueueTableProperty    qtable_prop;
     AQQueueProperty         queue_prop;
     AQQueueTable            q_table;
     AQQueue                 queue;

     /* Create a AQQueueTable property object (payload type - RAW): */
     qtable_prop = new AQQueueTableProperty("RAW"); 
    qtable_prop.setCompatible("8.1");

     /* Create a queue table called aq_table3 in aqjava schema: */
     q_table = aq_sess.createQueueTable ("aqjava", "aq_table3", qtable_prop);
     System.out.println("Successful createQueueTable");  

     /* Create a new AQQueueProperty object: */
     queue_prop = new AQQueueProperty();

     /* Create a queue called aq_queue3 in aq_table3: */
     queue = aq_sess.createQueue (q_table, "aq_queue3", queue_prop);
     System.out.println("Successful createQueue");  

     /* Enable enqueue/dequeue on this queue: */
     queue.start();
     System.out.println("Successful start queue");  
   
     /* Grant enqueue_any privilege on this queue to user scott: */
     queue.grantQueuePrivilege("ENQUEUE", "scott"); 
     System.out.println("Successful grantQueuePrivilege");  
}

2. Create a multi-consumer queue and add subscribers

public static void runTest(AQSession aq_sess) throws AQException
{
     AQQueueTableProperty    qtable_prop;
     AQQueueProperty         queue_prop;
     AQQueueTable            q_table;
     AQQueue                 queue;
     AQAgent                  subs1, subs2;

     /* Create a AQQueueTable property object (payload type - RAW): */
     qtable_prop = new AQQueueTableProperty("RAW"); 
     System.out.println("Successful setCompatible");  

     /* Set multiconsumer flag to true: */
     qtable_prop.setMultiConsumer(true);

     /* Create a queue table called aq_table4 in aqjava schema: */
     q_table = aq_sess.createQueueTable ("aqjava", "aq_table4", qtable_prop);
     System.out.println("Successful createQueueTable");  

     /* Create a new AQQueueProperty object: */
     queue_prop = new AQQueueProperty();
     /* Create a queue called aq_queue4 in aq_table4 */
     queue = aq_sess.createQueue (q_table, "aq_queue4", queue_prop);
     System.out.println("Successful createQueue");  

     /* Enable enqueue/dequeue on this queue: */
     queue.start();
     System.out.println("Successful start queue");  

     /* Add subscribers to this queue: */
     subs1 = new AQAgent("GREEN", null, 0);
     subs2 = new AQAgent("BLUE", null, 0);

     queue.addSubscriber(subs1, null); /* no rule   */
     System.out.println("Successful addSubscriber 1");  

     queue.addSubscriber(subs2, "priority < 2"); /* with rule */
     System.out.println("Successful addSubscriber 2");  
}


AQQueue

This interface supports the operational interfaces of queues. AQQueue extends AQQueueAdmin. Hence, you can also use adminstrative functions through this interface.


getOwner

Purpose:

This method gets the queue owner.

Syntax:

public java.lang.String getOwner() throws AQException


getName

Purpose:

This method gets the queue name.

Syntax:

public java.lang.String getName() throws AQException


getQueueTableName

Purpose:

This method gets the name of the queue table in which the queue resides.

Syntax:

public java.lang.String getQueueTableName() throws AQException


getProperty

Purpose:

This method is used to get the queue properties.

Syntax:

public AQQueueProperty getProperty() throws AQException

Returns:

AQQueueProperty object


createMessage

Purpose:

This method is used to create a new AQMessage object that can be populated with data to be enqueued.

Syntax:

public AQMessage createMessage() throws AQException

Returns:

AQMessage object


enqueue

Purpose:

This method is used to enqueue a message in a queue.

Syntax:

public byte[] enqueue(AQEnqueueOption enq_option,
                      AQMessage message) throws AQException

Table 7-47 alterPropagationSchedule Parameters
Parameter  Meaning 

enq_option  

AQEnqueOption object  

message  

AQMessage to be enqueued  

Returns:

Message id of the the enqueued message. The AQMessage object's messageId field is also populated after the completion of this call.


dequeue

Purpose:

This method is used to dequeue a message from a queue.

Syntax:

public AQMessage dequeue(AQDequeueOption deq_option) throws AQException

Table 7-48 alterPropagationSchedule Parameters
Parameter  Meaning 

deq_option  

AQDequeueOption object  

Returns:

AQMessage,the dequeued message


getSubscribers

Purpose:

This method is used to get a subscriber list for the queue.

Syntax:

public AQAgent[] getSubscribers() throws AQException

Returns:

An array of AQAgents


AQEnqueueOption

This class is used to specify options available for the enqueue operation.


Constants

public static final int DEVIATION_NONE
public static final int DEVIATION_BEFORE
public static final int DEVIATION_TOP
public static final int VISIBILITY_ONCOMMIT
public static final int VISIBILITY_IMMEDIATE


Constructors

Purpose:

There are two constructors available. The first creates an object with the specified options, the second creates an object with the default options.

Syntax:

public AQEnqueueOption(int visibility,
                       byte[] relative_msgid,
                       int sequence_deviation)

public AQEnqueueOption()

Table 7-49 AQEnqueueOption Parameters
Parameter  Meaning 

visibility 

VISIBILITY_IMMEDIATE or VISIBILITY_ONCOMMIT (default) 

relative_msgid  

when DEVIATION_BEFORE is used, this parameter identifies the message identifier of the message before which the current message is to be enqueued  

sequence_deviation  

DEVIATION_TOP-- the message is enqueued ahead of any other messages

DEVIATION_BEFORE -- the message is enqueued ahead of the message specified by relative_msgid

DEVIATION_NONE -- default  


getVisibility

Purpose:

This method gets the visibility.

Syntax:

public int getVisibility() throws AQException

Returns:

VISIBILITY_IMMEDIATE or VISIBILITY_ONCOMMIT


setVisibility

Purpose:

This method sets the visibility.

Syntax:

public void setVisibility(int visibility) throws AQException

Table 7-50 setVisibility Parameters
Parameter  Meaning 

visibility  

VISIBILITY_IMMEDIATE or VISIBILITY_ONCOMMIT  


getRelMessageId

Purpose:

This method gets the relative message id.

Syntax:

public byte[] getRelMessageId() throws AQException


getSequenceDeviation

Purpose:

This method gets the sequence deviation.

Syntax:

public int getSequenceDeviation() throws AQException


setSequenceDeviation

Purpose:

This method specfies whether the message being enqueued should be dequeued before other message(s) already in the queue

Syntax:

public void setSequenceDeviation(int sequence_deviation,
                                 byte[] relative_msgid) throws AQException

Table 7-51 setSequenceDeviation Parameters
Parameter  Meaning 

sequence_deviation  

DEVIATION_TOP-- the message is enqueued ahead of any other messages

DEVIATION_BEFORE -- the message is enqueued ahead of the message specified by relative_msgid

DEVIATION_NONE -- default  

relative_msgid  

when DEVIATION_BEFORE is used, this parameter identifies the message identifier of the message before which the current message is to be enqueued  


AQDequeueOption

This class is used to specify the options available for the dequeue option.


Constants

public static final int NAVIGATION_FIRST_MESSAGE
public static final int NAVIGATION_NEXT_TRANSACTION
public static final int NAVIGATION_NEXT_MESSAGE
public static final int DEQUEUE_BROWSE
public static final int DEQUEUE_LOCKED
public static final int DEQUEUE_REMOVE
public static final int DEQUEUE_REMOVE_NODATA
public static final int WAIT_FOREVER
public static final int WAIT_NONE
public static final int VISIBILITY_ONCOMMIT
public static final int VISIBILITY_IMMEDIATE


Constructor

Purpose:

This method creates an object with the default options.

Syntax:

public AQDequeueOption()


getConsumerName

Purpose:

This method gets consumer name.

Syntax:

public java.lang.String getConsumerName() throws AQException


setConsumerName

Purpose:

This method sets consumer name

Syntax:

public void setConsumerName(java.lang.String consumer_name) throws AQException

Table 7-52 setConsumerName Parameters
Parameter  Meaning 

consumer_name  

Agent name  


getDequeueMode

Purpose:

This method gets dequeue mode

Syntax:

public int getDequeueMode() throws AQException

Returns:

DEQUEUE_BROWSE, DEQUEUE_LOCKED, DEQUEUE_REMOVE or DEQUEUE_REMOVE_NODATA


setDequeueMode

Purpose:

This method sets the dequeue mode.

Syntax:

public void setDequeueMode(int dequeue_mode) throws AQException

Table 7-53 setDequeueMode Parameters
Parameter  Meaning 

dequeue_mode  

DEQUEUE_BROWSE, DEQUEUE_LOCKED, DEQUEUE_REMOVE or DEQUEUE_REMOVE_NODATA  


getNavigationMode

Purpose:

This method gets the navigation mode.

Syntax:

public int getNavigationMode() throws AQException

Returns:

NAVIGATION_FIRST_MESSAGE or NAVIGATION_NEXT_MESSAGE or NAVIGATION_NEXT_TRANSACTION


setNavigationMode

Purpose:

This method sets the navigation mode.

Syntax:

public void setNavigationMode(int navigation) throws AQException

Table 7-54 setNavigationMode Parameters
Parameter  Meaning 

navigation  

NAVIGATION_FIRST_MESSAGE or NAVIGATION_NEXT_MESSAGE or NAVIGATION_NEXT_TRANSACTION  


getVisibility

Purpose:

This method gets the visibility.

Syntax:

public int getVisibility() throws AQException

Returns:

VISIBILITY_IMMEDIATE or VISIBILITY_ONCOMMIT


setVisibility

Purpose:

This method sets the visibility.

Syntax:

public void setVisibility(int visibility) throws AQException

Table 7-55 setVisibility Parameters
Parameter  Meaning 

visibility  

VISIBILITY_IMMEDIATE or VISIBILITY_ONCOMMIT  


getWaitTime

Purpose:

This method gets the wait time.

Syntax:

public int getWaitTime() throws AQException

Returns:

WAIT_FOREVER or WAIT_NONE or the actual time in seconds


setWaitTime

Purpose:

This method sets the wait time.

Syntax:

public void setWaitTime(int wait_time) throws AQException

Table 7-56 setWaitTime Parameters
Parameter  Meaning 

wait_time  

WAIT_FOREVER or WAIT_NONE or time in seconds  


getMessageId

Purpose:

This method gets the message id.

Syntax:

public byte[] getMessageId() throws AQException


setMessageId

Purpose:

This method sets the message id.

Syntax:

public void setMessageId(byte[] message_id) throws AQException

Table 7-57 setMessageId Parameters
Parameter  Meaning 

message_id  

message id  


getCorrelation

Purpose:

This method gets the correlation id.

Syntax:

public java.lang.String getCorrelation() throws AQException


setCorrelation

Purpose:

This method sets the correlation id.

Syntax:

public void setCorrelation(java.lang.String correlation) throws AQException

Table 7-58 setCorrelation Parameters
Parameter  Meaning 

correlation  

user-supplied information  


AQMessage

This interface contains methods for AQ messages with raw or object payloads.


getMessageId

Purpose:

This method gets the message id.

Syntax:

public byte[] getMessageId() throws AQException


getRawPayload

Purpose:

This method gets the raw payload

Syntax:

public AQRawPayload getRawPayload() throws AQException

Returns:

AQRawPayload object


setRawPayload

Purpose:

This method sets the raw payload. It throws AQException if this is called on messages created from object type queues.

Syntax:

public void setRawPayload(AQRawPayload message_payload) throws AQException

Table 7-59 setRawPayload Parameters
Parameter  Meaning 

message_payload  

AQRawPayload object containing raw user data  


getMessageProperty

Purpose:

This method gets the message properties

Syntax:

public AQMessageProperty getMessageProperty() throws AQException 
  

Returns:

AQMessageProperty object


setMessageProperty

Purpose:

This method sets the message properties.

Syntax:

public void setMessageProperty(AQMessageProperty property) throws AQException

Table 7-60 setObjectPayload Parameters
Parameter  Meaning 

property  

AQMessageProperty object  


AQMessageProperty

The AQMessageProperty class contains information that is used by AQ to manage individual messages. The properties are set at enqueue time and their values are returned at dequeue time.


Constants

public static final int DELAY_NONE
public static final int EXPIRATION_NEVER
public static final int STATE_READY
public static final int STATE_WAITING
public static final int STATE_PROCESSED
public static final int STATE_EXPIRED


Constructor

Purpose:

This method creates the AQMessageProperty object with default property values.

Syntax:

public AQMessageProperty()


getPriority

Purpose:

This method gets the message priority.

Syntax:

public int getPriority() throws AQException


setPriority

Purpose:

This method sets the message priority.

Syntax:

public void setPriority(int priority) throws AQException

Table 7-61 setPriority Parameters
Parameter  Meaning 

priority  

priority of the message; this can be any number, including negative number - a smaller number indicates a higher priority  


getDelay

Purpose:

This method gets the delay value.

Syntax:

public int getDelay() throws AQException


setDelay

Purpose:

This method sets delay value.

Syntax:

public void setDelay(int delay) throws AQException

Table 7-62 setDelay Parameters
Parameter  Meaning 

delay  

the delay represents the number of seconds after which the message is available for dequeuing; with NO_DELAY the message is available for immediate dequeuing  


getExpiration

Purpose:

This method gets expiration value

Syntax:

public int getExpiration() throws AQException


setExpiration

Purpose:

This method sets expiration value

Syntax:

public void setExpiration(int expiration) throws AQException

Table 7-63 setExpiration Parameters
Parameter  Meaning 

expiration  

the duration the message is available for dequeuing; this parameter is an offset from the delay; if NEVER, the message will not expire  


getCorrelation

Purpose:

This method gets correlation

Syntax:

public java.lang.String getCorrelation() throws AQException


setCorrelation

Purpose:

This method sets correlation

Syntax:

public void setCorrelation(java.lang.String correlation) throws AQException

Table 7-64 setCorrelation Parameters
Parameter  Meaning 

correlation  

user-supplied information  


getAttempts

Purpose:

This method gets the number of attempts.

Syntax:

public int getAttempts() throws AQException


getRecipientList

Purpose:

This method gets the recipient list.

Syntax:

public java.util.Vector getRecipientList() throws AQException

Returns:

A vector of AQAgents.This parameter is not returned to a consumer at dequeue time.


setRecipientList

Purpose:

This method sets the recipient list.

Syntax:

public void setRecipientList(java.util.Vector r_list) throws AQException

Table 7-65 setRecipientList Parameters
Parameter  Meaning 

r_list  

vector of AQAgents; the default recipients are the queue subscribers  


getOrigMessageId

Purpose:

This method gets original message id.

Syntax:

public byte[] getOrigMessageId() throws AQException
     


getSender

Purpose:

This method gets the sender of the message.

Syntax:

public AQAgent getSender() throws AQException


setSender

Purpose:

This method sets the sender of the message.

Syntax:

public void setSender(AQAgent sender) throws AQException

Table 7-66 setSender Parameters
Parameter  Meaning 

sender  

AQAgent  


getExceptionQueue

Purpose:

This method gets the exception queue name.

Syntax:

public java.lang.String getExceptionQueue() throws AQException


setExceptionQueue

Purpose:

This method sets the exception queue name.

Syntax:

public void setExceptionQueue(java.lang.String queue) throws AQException

Table 7-67 setExceptionQueue Parameters
Parameter  Meaning 

queue  

exception queue name  


getEnqueueTime

Purpose:

This method gets the enqueue time.

Syntax:

public java.util.Date getEnqueueTime() throws AQException


getState

Purpose:

This method gets the message state.

Syntax:

public int getState() throws AQException

Returns:

STATE_READY or STATE_WAITING or STATE_PROCESSED or STATE_EXPIRED


AQRawPayload

This object represents the raw user data that is included in AQMessage.


getStream

Purpose:

This method reads some portion of the raw payload data into the specified byte array.

Syntax:

public int getStream(byte[] value, int len) throws AQException

Table 7-68 getStream Parameters
Parameter  Meaning 

value  

byte array to hold the raw data  

len  

number of bytes to be read  

Returns:

The number of bytes read


getBytes

Purpose:

This method retrieves the entire raw payload data as a byte array.

Syntax:

public byte[] getBytes() throws AQException

Returns:

byte[] - the raw payload as a byte array


setStream

Purpose:

This method sets the value of the raw payload.

Syntax:

public void setStream(byte[] value,
                      int len) throws AQException

Table 7-69 getStream Parameters
Parameter  Meaning 

value  

byte array containing the raw payload  

len  

number of bytes to be written to the raw stream  


AQException

This exception is raised when the user encounters any error while using the Java AQ Api.

public class AQException extends java.lang.RuntimeException

This interface supports all methods supported by Java exceptions and some additional methods.


getMessage

Purpose:

This method gets the error message.


getErrorCode

Purpose:

This method gets the error number (Oracle error code).


getNextException

Purpose:

This method gets the next exception in the chain if any.


AQOracleSQLException

AQOracleSQLException extends AQException.

When using Oracle8i AQ driver, some errors may be raised from the client side and some from the RDBMS. The Oracle8i driver raises AQOracleSQLException for all errors that ocuur while performing SQL.

For sophisticated users interested in differentiating between the two types of exceptions, this interface might be useful. In general you will only use AQException.




Prev

Next
Oracle
Copyright © 1999 Oracle Corporation.

All Rights Reserved.

Library

Product

Contents

Index