Data Connection Data Source

Applies to ReadyAPI 3.56, last modified on October 29, 2024

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.

Configuration

The Data Connection data source

Click the image to enlarge it.

Prepared Properties

A table that contains prepared properties used in the SQL Query. To learn how to work with prepared properties, see Prepared Properties.

Connection

Specifies the name of a database connection.

Configure

Opens the Database configuration dialog to modify the selected database connection.

TestConnection

Tests the selected database connection.

SQL Query

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 (::) syntax.

Fetch Size

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 -2147483648 value to obtain one row in a roundtrip. Other values are ignored.

Stored Procedure

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.

Example

Build Query

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.

See Also

Basic Concepts of Data-Driven Testing
Data Source Loop Test Step
JDBC Data Source
Database Manager
Data Source Types

Watch the video
 
Highlight search results