Recording SQL events

When the Rational® Integration Tester JDBC proxy is installed, you can use Rational® Integration Tester and Rational® Test Virtualization Server to record SQL events that are executed against databases from applications that use JDBC. There are two methods of selecting a database for recording: Architecture School method and Recording Studio method. Both methods achieve the same result but the Architecture School method is a more direct method.

Before you begin

  1. Install the Rational® Integration Tester JDBC proxy. For more information, see Setting up the JDBC proxy.
    Note: You can record Db2® for z/OS® SQL events from COBOL or PL/I programs running on z/OS. For more information, see Testing with IBM Db2 on z/OS systems.
    Remember: The version number of the IBM® Rational® Test Control Panel software that you are using must be the same as the version number of the Rational® Integration Tester software that you are using. Therefore, if you upgraded your Rational® Integration Tester installation and you want to record SQL or create database stubs, you must upgrade your server installation and upgrade the JDBC proxy wherever it is deployed.
  2. In Rational® Test Control Panel, ensure that the proxy is registered with the server. For more information, see Administration of Rational Test Control Panel.

About this task

( Rational® Test Virtualization Server users can also create, edit, and start/stop database stubs. For information about using Rational® Test Virtualization Server, see Rational Test Virtualization Server overview.)

The ability to record SQL events (but not create any database stubs) is useful if you are building test cases in Rational® Integration Tester and want to extract SQL results from queries on a database for analysis or for use in test cases.

You can also record stored procedures. The recorded SQL statements now include SQL Result Sets. For more information on the details that are saved, see Events view.

The following diagram illustrates how Rational® Integration Tester records SQL from databases that use JDBC.

Diagram of RIT recording SQL from JDBC databases

Architecture School method

Procedure

There are two ways to use the Architecture School Logical View to record a database.
  • Right-click the logical database that is to be recorded, and click Add event monitor on the menu. Alternatively, select the logical database that is to be recorded, and click Add event monitors for the selected items on the toolbar.
  • The Recording Studio opens with the resource listed in the Event Monitor window. To start recording, click Record on the Events View toolbar.
When the application under test makes SQL calls, they are visible in Recording Studio.

Recording Studio method

Procedure

  1. Click + on the Event Monitors toolbar to create an event monitor.

    The Select a Resource dialog box is displayed.

  2. On the Select a Resource dialog box, click the Show/Hide Recordable Resources button. For more information, see Monitoring operations or transports.
  3. Select the relevant logical database. Click OK.
  4. Click Record on the Events View toolbar.

    The Create Stubbed Database Whilst Recording? dialog box is displayed.

  5. Click the No thanks, just record the SQL option button.
  6. Open the Recording Studio wizard for creating database stubs.

    The first screen of the wizard is displayed.

  7. Click the Start recording option button.
  8. Click Finish.

    When the application under test makes JDBC SQL calls, they are visible in the Recording Studio Events View window. Click each SQL event to view its details, or to copy the SQL to a test case in Rational® Integration Tester or to another application.