All docs This doc
Skip to end of metadata
Go to start of metadata

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 Enterprise Integrator (WSO2 EI) supports the JNDI InitialContext implementation by inheriting the JNDI implementation of Tomcat ( 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.

Follow the topics below. Also, see the samples in Data Integration Samples.


Start the Create New Data Service wizard

Now, let's start creating the data service from scratch:

  1. Download the product installer from here, and run the installer.
    Let's call the installation location of your product the <EI_HOME> directory. This is located in a place specific to your OS as shown below:

    OSHome directory
    Mac OS/Library/WSO2/EnterpriseIntegrator/6.5.0
    WindowsC:\Program Files\WSO2\EnterpriseIntegrator\6.5.0\

  2. Start the ESB profile:

    Open a terminal and execute the following command:

    Go to Start Menu -> Programs -> WSO2 -> Enterprise Integrator 6.4.0 Integrator. This will open a terminal and start the ESB profile.

Add a JNDI datasource

You can add a JNDI datasource by following the steps given below.

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

Define a query for the datasource

Now let's start writing a query for getting data from the datasource. The query will specify the data that should be fetched by this query, and the format that should be used to display data when the query is invoked.

  1. Click Add New Query to open the Add New Query screen.
  2. Enter the following values:
    • Query ID: Enter an ID for the query.
    • Datasource: Select the datasource for which you are going to write a query. Select the JNDI datasource that you created previously.
    • SQL: In this field, enter the SQL statement describing the data that should be retrieved from the RDBMS datasource.

  3. Add input mappings: Input mappings allow you to add parameters to a query so that you can set the parameter value when executing the query. 

  4. Add output mappings: Out mapping is used to specify how the data that is fetched from your query will be shown in the response.

  5. Click Next to open the Operations screen.

Define an operation to invoke the query

Data service operations are written to invoke queries.

  1. Click Add New Operation to open Add New Operation screen.
  2. Add a name for your operation in the Operation Name field.
  3. In the Query ID field, select the query that you defined previously.
  4. Save the operation.

Finish creating the data service

Once you have defined the operation, click Finish to complete the data service creation process. You will now be taken to the Deployed Services screen, which shows all the data services deployed on the server.

  • No labels