Selecting and enabling JDBC data sources in WebSphere® Application Server

For each JDBC data source that you want to record or virtualize, you must use HCL DevOps Test Integrations and APIs (Test Integrations and APIs) to select and enable the data source.

About this task

Each application under test will normally connect to databases using JDBC data sources that are looked up by means of a JNDI reference. You can use Test Integrations and APIs to view the JDBC data sources that are available in your IBM® WebSphere® Application Server installation.

If you enable JDBC virtualization for WebSphere® Application Server and want to record or virtualize a database management system supported by Test Integrations and APIs, the following three JDBC data sources are required:
  • The JDBC data source for connecting to the live database. This data source is not created automatically, so you must create it manually in WebSphere® Application Server.
    Note: For information about manually creating a data source that connects to a live database, see the WebSphere® Application Server information center.
  • The JDBC data source for connecting to the simulation database. Depending on the version of Test Integrations and APIs and the database management system software that you are using, the data source that connects to the simulation database might be created automatically in WebSphere® Application Server by Test Integrations and APIs.
    Test Integrations and APIs version Database management system Data source that connects to the simulation database
    8.5.1 or later IBM® Db2®, Oracle, Microsoft SQL Server, MySQL Created automatically by Test Integrations and APIs
    Versions earlier than 8.5.1 Db2® Created automatically by Test Integrations and APIs
    Oracle, Microsoft SQL Server, MySQL Must be created manually in WebSphere® Application Server
  • The Test Integrations and APIs data source, which is created automatically in WebSphere® Application Server when you enable a WebSphere® Application Server data source in Test Integrations and APIs for recording or virtualization.
Enabling a JDBC data source reconfigures WebSphere® Application Server so that use of the data source can be recorded and virtualized.
Note: If the JDBC data source that connects to a simulation database is not created automatically for Test Integrations and APIs and the database management system software, create it manually in WebSphere® Application Server before you can enable it for recording or virtualization.

Procedure

Prerequisites: The JDBC driver must be deployed on each application server that is running WebSphere® Application Server. See, Deploying JDBC proxy into WebSphere Application Server
  1. In Test Integrations and APIs, click IBM on the Physical View toolbar of the Physical View of Architecture School.
  2. On the IBM menu, click IBM WebSphere Application Server.

    The New IBM WebSphere Application Server window is displayed.

  3. Specify the WebSphere® Application Server host name and the port to connect to. Click Test Transport to test the connection to WebSphere® Application Server.
  4. Click the Data Sources tab.

    The data sources that are configured on WebSphere® Application Server are displayed.

  5. Select the data source for which you want to enable SQL recording and database stubbing and click Enable GH JDBC Driver.

    Alternatively, to stop SQL recording and database stubbing for the selected data source, click Disable GH JDBC Driver.

    Note: If you need to create a data source that connects to a simulation database:
    • Select the data source that you configured to connect to the simulation database.
    • If the Test Integrations and APIs project contains more than one database, a confirmation prompt is displayed.
    • Select the database that you want to enable for SQL recording and database stubbing.
    • Select the connection string that matches the data source that you want to enable for database recording.
    Note: If you are using Test Integrations and APIs with WebSphere® Application Server Network Deployment:
    • Ensure that the Config tab contains connection settings for the relevant deployment manager if you are using federated servers and one or more deployment managers.
    • The Scope column on the Data Sources tab indicates the scope (cell, node, or server level) at which each displayed data source is being managed.
    • By having a physical connection to the relevant deployment manager, you can configure data sources at any level in the WebSphere® Application Server hierarchy.

    The Data Source Status column refreshes to confirm that the selected data source is now enabled (or disabled) for database stubbing.

    To facilitate enabling SQL recording and database stubbing, Test Integrations and APIs defines two new data sources and renames the original data source in JNDI.
    Note: If you are using Test Integrations and APIs with WebSphere® Application Server Network Deployment, and try to configure a data source where the JDBC driver is not enabled at the correct level in the hierarchy, an error message is displayed. Clicking OK to close the dialog box displays a message that prompts you to restart all WebSphere® Application Server instances that are impacted by the data source changes. When the instances are restarted, the changes take effect on all those instances.

Results

When an application looks up the specified data source in JNDI, it receives a Test Integrations and APIs stub data source if the following conditions are met:
  • The application is hosted on the server that is running WebSphere® Application Server
  • The server is using the specified data source
The stub data source looks up connections to the live and simulation databases as needed.