Testing or deploying a Web project that uses SDO on a remote server

You can test or deploy a Web project that uses Service Data Objects (SDO) for data access to a remote WebSphere® Application Server V6 or V6.1 (or Portal servers) from within the Rational application development product or through the WebSphere administrative console. For Web projects that use WebSphere Data Objects (WDO) for data access to a remote WebSphere Application Server V5.1.0.3 (or higher), you can also use the administrative console or the Rational application development product; however, if you want to test or deploy from within the Rational application development product, you must have separately installed an IBM® Agent Controller on your WebSphere server before you begin. For updated information on Agent Controller, refer to the Read Me document on the Agent Controller installation disk.

Important: It is critical that you follow only one of the procedures below before remotely testing or deploying a Web application that uses WDO; if you do not, you might interfere with the settings in the WebSphere administrative console on the server.

Using the Rational application development product

When using the SDO tools from an installation of the product that targets a WebSphere-based runtime, the deployment information is automatically configured. To verify or change these settings, complete the following steps:
  1. From within your Web project, set the location information for the database and the JDBC driver on your server.
    Note: If you are using a Cloudscape™ database, you must update the Class Location and Database Location to reflect the paths on your server machine. You can use variables setup in your server. For example, the path ${CLOUDSCAPE_JDBC_DRIVER_PATH}\db2j.jar points to the Cloudscape driver included with WebSphere Application Server. The path ${APP_INSTALL_ROOT}\localhost\DefaultEAR.ear\myproject.war\CloudscapeData\database points to your database, where your EAR project retains the default name of DefaultEAR and your Web project is named myproject. For databases other than Cloudscape, you must update the Class Location.
    1. In Project Explorer select the project containing SDOs. Then right-click and select Properties from the context menu. Go to the JDBC Connections property page.
    2. Select the connection from the list of available connections in the Name drop down list.
    3. From the Development connection details, optionally click the Change button to modify your development-time connection. When you are finished, you will be given the option to update your runtime connection with those changes.
    4. From the Connections tab, click Edit next to the "Runtime connection details" to modify the existing database connection. If you do not have a database connection already configured, refer to Connecting to a database using a wizard.
    5. Enter the paths in the Class Location field with the server-side locations of the JDBC driver jar files.
    6. Complete all other steps in the wizard, then click Finish.
    7. Click OK on the property page.
  2. Right-click your Web project in the Project Explorer and select Run As-->Run on Server to deploy your application to the remote server for testing.

Using the administrative console

  1. From within the Rational application development product, click File > Export > Ear file to export your application to an EAR file.
  2. If it is not already started, start the WebSphere Application Server.
  3. In a browser, navigate to your server's administrative console and log in. By default, the URL for accessing the console of a WebSphere V5.1.0.3 (or higher) server is http://servername.domain:9090/admin/. The default URL for accessing a WebSphere V6 server is http://servername.domain:9060/ibm/console.
  4. Create the JDBC datasource. For detailed instructions, see the "Creating and configuring a JDBC provider using the administrative console" topic in the WebSphere V5.1 and V6 information center.
    Note: The JNDI Name must match the name given to the data source when it was created in the workbench. You can find this data source name in the web.xml file, located in the WebContent/WEB-INF folder of your project. The res-ref-name name element specifies the name of a resource manager connection factory reference, for example:
    <resource-ref id="ResourceRef_100">
           <res-ref-name>DB2_Connection_2</res-ref-name>
           <res-type>javax.sql.DataSource</res-type>
           <res-auth>Container</res-auth>
           <res-sharing-scope>Shareable</res-sharing-scope>
    </resource-ref>
  5. Install your application. For detailed instructions, see the "Installing application files with the console" topic in the WebSphere V5.1 and V6 information center.
    Note: In the "Map resource references to resources" step, specify the JNDI name for the resource.
  6. If you are deploying on a WebSphere V5.1.0.3 (or higher) server, create the shared library and update the EAR properties. If you are deploying on a WebSphere V6.0 server, skip this step.
    Note: Do not manually add the shared libraries information to your classpath.
    1. Select Environment > Shared libraries.
    2. Click New.
    3. Enter the following:
      Name = WDO Relational Mediator Shared Library
      Classpath = ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo-interface.jar
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/emf-runtime.jar
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/emf-event.jar
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/jdbcmediator.jar
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo.jar
      ${WAS_INSTALL_ROOT}/optionalLibraries/WDO/wdo.xmlmediator.jar
    4. Click OK to commit the changes.
    5. Select Applications > Enterprise Applications and select your EAR file.
    6. Switch your Applications Classloader Mode to PARENT_LAST.
    7. Select Libraries from the Additional Properties section at the bottom of the page.
    8. Click Add.
    9. Select your Shared Library.
    10. Click OK to commit the change.
  7. Click Save to save your changes, then run the application.

Feedback