Database actions
Working with messages is a large component of the tests that you create with HCL OneTest™ API. However, in most systems, you also interact with databases. For example, you might want to check that data was added or removed from a database correctly. Or, you might want to insert data, or run a stored procedure on a database as part of a larger test. If you have the appropriate JDBC drivers and can specify the locations of these drivers to the Library Manager, HCL OneTest™ API can interact with any JDBC-compliant database. After the JDBC drivers are set up, you can create a database within the Architecture School perspective, just like you do for any other infrastructure component, and can work with the database by adding actions to your tests. You can use three database actions: the SQL Command action, the SQL Query action, and the Stored Procedure action.
SQL Command
This action runs an SQL command (insert, update, or delete rows) on a database resource. As you add this action, you can validate or store into a tag the number of rows affected. For more information, see Adding an SQL Command action to a test.
SQL Query
This action queries the selected database to verify that its contents match the selected values. As you add this action, you can validate or store the query results. For more information, see Adding an SQL Query action to a test.
Stored Procedure
This action calls a stored procedure from the selected database. As you add this action, you can view the code of the stored procedure, specify input values, tag return values, or specify the expected return values. For more information, see Adding a Stored Procedure action to a test.