Create or changing a resource reference

A resource reference supports application provider access to a resource (such as a data source, URL, or mail provider) using a logical name rather than the actual name in the run time environment. This ability insulates the application provider from the run time configuration, and simplifies the process of changing the run time configuration.

Resource references are declared in the deployment descriptor by the application provider. At some point in the application deployment process, bind the resource reference to the actual name of the resource in the run time environment.

Steps for this task

  1. Start the Application Assembly Tool. Cancel the Welcome to the Application Assembly Tool window.
  2. Click File > Open. Find the EAR file you want to change, click the file name, and click Open.
  3. Display the resource references for the type of application component:

    • If an enterprise bean uses the resource reference:

      • Expand the name of the EAR file
      • Expand EJB Modules
      • Expand the EJB module wanted
      • Expand the section for the appropriate type of enterprise bean (Session Beans or Entity Beans)
      • Expand the enterprise bean

    • If a servlet uses the resource reference:

      • Expand the name of the EAR file
      • Expand Web Modules
      • Expand the Web module wanted

    • If an application client uses the resource reference:

      • Expand the name of the EAR file
      • Expand Application Clients
      • Expand the application client module wanted

  4. Click Resource References.
  5. Right-click Resource References and click New to display the new Resource Reference window.
  6. Specify settings.
  7. Click IBM Extensions and select the Isolation level.
  8. Click Bindings and fill in the JNDI name. You can choose to skip this step, as you are allowed to fill in or change this field during installation of the EAR file.
  9. Click OK.
  10. Save the EAR file. See Saving applications after assembly
  11. Generate the code. See Generating code for deployment