Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Java Naming and Directory Interface (JNDI) is a Java API (application programming interface) providing naming and directory functionality for Java software clients to discover and look up data and objects via a name.  WSO2 Data Services Server supports JNDI InitialContext implementation by inheriting the JNDI implementation of Tomcat (http://tomcat.apache.org/tomcat-7.0-doc/jndi-resources-howto.html). JNDI helps decouple object creation from the object look-up. When you have registered a datasource with JNDI, others can discover it through a JNDI lookup and use it.

Before creating a datasource with JNDI, follow the steps in Creating datasources. When you select JNDI as the datasource type at the time a datasource is created, the JNDI-specific options appear. For example:You can create the JNDI data source as you create your data service: Follow the steps from 1 to 3 in creating data services using various data sources . When you get to the    Add New Data Source    screen, select JNDI     as the data source type. The JNDI-specific options will now be available for editing as shown below. 

The options in the above window are explained below:

JNDI Context Class: The corresponding context factory class

Provider URL: The URL which specifies the location of a resource on the Web.

Resource Name: The name of the JNDI resource

You can also expose a RDBMS Carbon datasource as a JNDI datasource using the Configure > Datasources menu of the management console. For instructions, see Adding datasources  .

...