1 Reply Latest reply: May 20, 2005 2:02 PM by 387865 RSS

    Connect to OID using JNDI name?

      I would like to connect to OID from a J2EE app deployed on Oracle 9iAS using a JNDI name.

      I am currently using datasources in this manner, for example:

      Context ic = new InitialContext();
      ds = (DataSource) ic.lookup("jdbc/OracleDS");

      will return the datasource defined by the JNDI name jdbc/OracleDS.

      I would like to access OID in the same way ie bind the OID URL to a JNDI name and then have references in the code use the JNDI name.

      I've not been able to find much documentation on this - can anyone help - is it possible?


        • 1. Re: Connect to OID using JNDI name?
          I found several way of doing this:

          1. store the ldap connect info in a database table
          this way you use JNDI datasource lookup to connect to the Database and read the LDAP connect string from there

          2. specify the LDAP connect string in the web.xml file and use jndi lookup look at this doc how to doit - http://www.macromedia.com/v1/handlers/index.cfm?ID=18859&Method=Full

          3. You can try creating external JNDI reource: http://docs.sun.com/source/819-0076/jndi.html

          4. Lastly you can specify system property with -D.... parameter on the JVM start line (in OC4J server.xml )