Migrating applications to use data sources of the current Java EE Connector Architecture (JCA)

Migrate your applications that use Version 4 data sources, or data sources (WebSphere® Application Server V4), to use data sources that support more advanced connection management features, such as connection sharing.

About this task

To use the connection management infrastructure in the application server, you must package your application as a Java EE 1.3 or later application. This process involves repackaging your web modules to the 2.3 specification and your EJB modules to the 2.1 specification before installing them onto WebSphere Application Server.

[z/OS]Applications remaining at the Java EE 1.2 level will continue to run fine using the connection management support that was available at V4.0; simply create the JDBC provider and data source, and install the 4.0 application as-is. If you choose to repackage your application for version 6.0 or later you can not use a Version 4.0 data source. You must use the other data source option, which supports applications coded to the Java EE 1.3 specifications, at minimum.

Procedure

  • Convert a 2.2 web module to a 2.3 web module
    1. Create a new web module by selecting File > New > Web Module.
    2. Add any required class files to the new module.
      1. Expand the Files portion of the tree.
      2. Right-click Class Files and select Add Files.
      3. In the Add Files window, click Browse.
      4. Navigate to your WebSphere Application Server 4.0 EAR file and click Select.
      5. In the Add Files window, navigate to your WAR file and expand the WEB-INF and classes directories.
      6. Select each of the directories and files in the classes directory and click Add.
      7. After you add all of the required class files, click OK.
    3. Add any required JAR files to the new module.
      1. Expand the Files portion of the tree.
      2. Right-click Jar Files and select Add Files.
      3. Navigate to your WebSphere 4.0 EAR file and click Select.
      4. In the Add Files window, navigate to your WAR file and expand the WEB-INF and lib directories.
      5. Select each JAR file and click Add.
      6. After you add all of the required JAR files, clickOK.
    4. Add any required resource files, such as HTML files, JSP files, GIFs, and so on, to the new module.
      1. Expand the Files portion of the tree.
      2. Right-click Resource Files and select Add Files.
      3. Navigate to your WebSphere Application Server 4.0 EAR file and click Select.
      4. In the Add Files window, navigate to your WAR file.
      5. Select each of the directories and files in the WAR file, excluding META-INF and WEB-INF, and click Add.
      6. After you add all of the required resource files, clickOK.
    5. Import your web components.
      1. Right-click Web Components and select Import.
      2. In the Import Components window click Browse.
      3. Navigate to your WebSphere Application Server 4.0 EAR file and click Open.
      4. In the Import Components window, highlight the WAR file that you are migrating.
      5. Highlight each of the components and click Add.
      6. When all of your web components display in the Selected Components pane of the window, click OK.
      7. Verify that your web components are correctly imported under the Web Components section of your new web module.
    6. Add servlet mappings for each of your web components.
      1. Right-click Servlet Mappings and select New.
      2. Identify a URL pattern for the web component.
      3. Select the web component from the Servlet drop-down box.
      4. Click OK.
    7. Add any other web module properties that are required. Click Help for a description of the settings.
    8. Save the web module.
  • Convert a 1.1 EJB module to a 2.1 EJB module (or later)
    1. Open an assembly tool.
    2. Create a new EJB Module by selecting File > New > EJB Module.
    3. Add any required class files to the new module.
      1. Right-click Files object and select Add Files.
      2. In the Add Files window click Browse.
      3. Navigate to your WebSphere Application Server 4.0 EAR file and click Select.
      4. In the Add Files window, navigate to your enterprise bean JAR file.
      5. Select each of the directories and class files and click Add.
      6. After you add all of the required class files, click OK
    4. Add any other EJB module properties that are required. Click Help for a description of the settings.
    5. Save the EJB module.
    6. Generate the deployed code for the EJB module by clicking File > Generate Code for Deployment.
    7. Fill in the appropriate fields and click Generate Now.
  • Add the EJB modules and web modules to an EAR file
    1. Create a new Application by selecting File > New > Application.
    2. Add each of your EJB modules.
      1. Right-click EJB Modules and select Import.
      2. Navigate to your converted EJB module and click Open.
      3. Click OK.
    3. Add each of your web modules.
      1. Right-click Web Modules and select Import.
      2. Navigate to your converted web module and click Open.
      3. Fill in a Context root and click OK.
    4. Identify any other application properties. Click Help for a description of the settings.
    5. Save the EAR file.
  • Install the application on the application server.
    1. Install the application following the instructions in the topic on installing a new application, and bind the resource references to the data source that you created.
    2. Perform the necessary administrative task of creating a JDBC provider and a data source object following the instructions in the topic on creating a JDBC provider and data source.