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.

Registering a Queue/Topic Connection Factory Through LDAP—with JDBC Connection Parameters<br />

See Also:<br />

Table 13–1 for a list of JMS administrative interface basic<br />

<br />

operations<br />

"Class - oracle.jms.AQjmsFactory" on page B-49<br />

"Registering a Queue/Topic Connection Factory Through<br />

<br />

LDAP—with a JDBC URL" on page 13-11<br />

Purpose<br />

Register a queue/topic connection factory through LDAP with JDBC connection<br />

parameters to LDAP.<br />

Usage Notes<br />

registerConnectionFactory is a static method. To successfully register the<br />

connection factory, the hashtable passed to registerConnectionFactory must<br />

contain all the information to establish a valid connection to the LDAP server.<br />

Furthermore, the connection must have write access to the connection factory<br />

entries in the LDAP server (which requires the LDAP user to be either the database<br />

itself or be granted global_aq_user_role). After registration, look up the<br />

connection factory using JNDI.<br />

Syntax<br />

See Java (JDBC): <strong>Oracle</strong>9i Supplied Java Packages Reference oracle.jms,<br />

AQjmsFactory.registerConnectionFactory.<br />

Example<br />

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

/* the following statements set in hashtable env:<br />

* service provider package<br />

* the URL of the ldap server<br />

* the distinguished name of the database server<br />

* the authentication method (simple)<br />

* the LDAP user name<br />

* the LDAP user password<br />

*/<br />

env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");<br />

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

env.put("searchbase", "cn=db1,cn=<strong>Oracle</strong>context,cn=acme,cn=com");<br />

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

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

JMS Administrative Interface: Basic Operations 13-9

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

Saved successfully!

Ooh no, something went wrong!