The Data Connection data source gets data from the database by using a predefined JDBC database connection. It allows you to specify one connection and use it in several functional test steps, as well as in the virtual service data source within the project.
If you need to use this connection only once, you can use the JDBC data source.
|Note:||To use the data connection data source, you need to install a database driver. To learn how to do this, see Installing Database Drivers.|
The data source assigns values it got to the properties whose names match the names of the database columns or aliases.
|In this topic, we focus on how to configure the Data Connection data source. We assume you are already familiar with data-driven testing and how to configure a data-driven loop. Otherwise, please read Basic Concepts of Data-Driven Testing, or complete some of our tutorials before you continue.|
A table that contains prepared properties used in the SQL Query. To learn how to work with prepared properties, see Prepared Properties.
Specifies the name of a database connection.
Opens the Database configuration dialog to modify the selected database connection.
Tests the selected database connection.
Specifies the query to the database. To use a test step parameter in the query, specify the name of the desired parameter with the leading colon character (
:parameter). You can specify the desired query manually or by using the Build SQL Query or Create Query dialog.
|Currently, you cannot use SQL queries with the double-colon (
Specifies the number of rows obtained in one database roundtrip.
|Due to the specifics of the MySQL Connector/J drivers, when you work with MySQL databases, you can specify only the
Select this option if your query is a call to a stored procedure. In this case, you specify the name of the stored procedure and its parameters in the SQL Query field.
The passed parameters must be in the same order as they are declared in the database.
ReadyAPI assigns values obtained from database columns to properties with the same names. For example, it assigns the data from the “Order” column to the “Order” property.
Imagine there is the
getOrdersByStatus stored procedure in your database. The procedure obtains the data from the Order, ExpDate, and Customer columns for entries that have the specified status. To use the stored procedure:
Create the Order, ExpDate, and Customer properties.
Specify the name of the procedure in the SQL Query field.
Specify the needed parameters in the order declared in the database. In this example, the stored procedure requires two parameters: the first parameter is the desired status, and the second one - a quantity of entries to return.
Opens a dialog to specify an SQL Query. If the Stored Procedure option is enabled, it opens the Create Query dialog, otherwise – the Build SQL Query dialog.