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.

JMS Connection and Session<br />

General Features of JMS<br />

Connection Factory<br />

A ConnectionFactory encapsulates a set of connection configuration parameters<br />

that has been defined by an administrator. A client uses it to create a Connection<br />

with a JMS provider. In this case <strong>Oracle</strong> JMS, <strong>Oracle</strong>8i is the JMS Provider.<br />

There are two types of ConnectionFactory objects<br />

QueueConnectionFactory<br />

TopicConnectionFactory<br />

<br />

ConnectionFactory objects can be obtained in one of the following ways<br />

1. Static methods in AQjmsFactory<br />

2. Java Naming and Directory Interface (JNDI) Lookup from a LDAP directory<br />

server<br />

Using AQjmsFactory to Obtain ConnectionFactory Objects<br />

The AQjmsFactory class can be used to obtain a handle to Queue/Topic<br />

ConnectionFactory objects.<br />

To obtain a QueueConnectionFactory, use the<br />

<br />

AQjmsFactory.getQueueConnectionFactory() method<br />

The queue connection factory can be created using hostname, port number, SID<br />

driver or by using JDBC URL and properties.<br />

To obtain a TopicConnectionFactory, use the<br />

<br />

AQjmsFactory.getTopicConnectionFactory() method<br />

The topic connection factory can be created using hostname, port number, SID<br />

driver or by using JDBC URL and properties.<br />

Example<br />

public static void get_Factory() throws JMSException<br />

{<br />

QueueConnectionFactory qc_fact = null;<br />

/* get queue connection factory for database "aqdb", host "sun-123", port<br />

5521, driver "thin" */<br />

qc_fact = AQjmsFactory.getQueueConnectionFactory("sun-123", "aqdb", 5521,<br />

"thin");<br />

}<br />

Creating Applications Using JMS 12-5

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

Saved successfully!

Ooh no, something went wrong!