09.12.2012 Views

Advanced Queuing - Oracle

Advanced Queuing - Oracle

Advanced Queuing - Oracle

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

General Features of JMS<br />

To connect directly to LDAP, the parameters for the<br />

registerConnectionFactory method include the LDAP context, the name of<br />

the Queue/Topic ConnectionFactory, hostname, database SID, port<br />

number, JDBC driver (thin or oci8) and factory type (queue or topic).<br />

Connect to LDAP through the database server - the user can log on to the<br />

<br />

<strong>Oracle</strong>9i database first and then have the database update the LDAP entry.<br />

The user that logs on to the database must have the AQ_ADMINISTRATOR_<br />

ROLE to perform this operation.<br />

To connect directly to LDAP through the database server, the parameters<br />

for the registerConnectionFactory method include a JDBC connection (to a<br />

user having AQ_ADMINISTRATOR_ROLE), the name of the Queue/Topic<br />

ConnectionFactory, hostname, database SID, port number, JDBC driver<br />

(thin or oci8) and factory type (queue or topic).<br />

After the Connection Factory objects have been registered in LDAP by a JMS<br />

administrator, they can be looked up by using JNDI<br />

Example<br />

Lets say the JMS administrator wants to register a order entry queue connection<br />

factory, oe_queue_factory. In LDAP, it can be registered as follows:<br />

public static void register_Factory_in_LDAP() throws Exception<br />

{<br />

Hashtable env = new Hashtable(5, 0.75f);<br />

env.put(Context.INITIAL_CONTEXT_FACTORY, AQjmsConstants.INIT_CTX_FACTORY);<br />

// aqldapserv is your LDAP host and 389 is your port<br />

env.put(Context.PROVIDER_URL, "ldap://aqldapserv:389);<br />

// now authentication info<br />

// username/password scheme, user is OE, password is OE<br />

env.put(Context.SECURITY_AUTHENTICATION, "simple");<br />

env.put(Context.SECURITY_PRINCIPAL, "cn=oe,cn=users,cn=acme,cn=com");<br />

env.put(Context.SECURITY_CREDENTIALS, "oe");<br />

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

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

AQjmsFactory.registerConnectionFactory(env, "oe_queue_factory", "sun-123",<br />

"aqdb", 5521, "thin", "queue");<br />

}<br />

Creating Applications Using JMS 12-7

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

Saved successfully!

Ooh no, something went wrong!