Setting up a logical and physical database
Before you can create database stubs, you must set up a logical and physical database in HCL OneTest™ API.
About this task
Before you can create database stubs, you must specify in HCL OneTest™ API which database schema is to be used for the simulation database.
Procedure
- Open the Logical View of the Architecture School.
- On the toolbar of Logical View, click General
> Database Server.
- In the Name field, enter a name for the logical database resource that represents the database against which you will record activity or that which you will stub. Click OK.
- Click the Physical View tab.
- On the toolbar of Physical View tab, click General > Database.
- Optional: In the Name field, enter a name for the physical database.
- In the Maximum Number of Connections field,
enter the maximum number of database connections from
HCL OneTest™ API that are to be available in the pool.If you leave this field blank, it defaults to 1. You might increase the value if you run multiple tests that use the same database resource concurrently.
- In the Driver list, click the relevant driver.
- In the Database URL field,
enter the connection string that is used by the application that is
making JDBC calls to the database. For more information on the specification
of database URLs when using IP literal addresses, see IP literal address.
Note: The connection string must match the connection string that is used by the application that is making JDBC calls to the database. This is because the JDBC proxy uses the connection string that is entered in HCL OneTest™ API physical resource to match connections to databases made by applications.
- In the User Name and Password fields,
enter the name and password of the relevant database user.Note: The user name and password must be provided by a database administrator (DBA).
- Click Test Connection to verify that HCL OneTest™ API can connect to the specified database.
- If you are stubbing the specified database,
click the Stub Settings tab. Note: If you are recording SQL from the specified database but not stubbing it, there is no need to enter any data on the Stub Settings tab.
- Click the Logical View tab.
On the Logical View pane, right-click the logical
database resource and click Set Binding in and
the relevant environment and physical database on the menus. This
resource represents the database against which you are going to record
activity against or that you want to stub.
Alternatively, on the Logical View pane, double-click the logical database resource to open the Database Server window, click the Bindings tab, click the relevant environment, and click the relevant physical database in the Binding list for that environment.