The JDBC component allows a test to query data from a database.
Typical use cases are:
- to retrieve data items to use as input data
- to perform data driven testing
The currently supported databases are: MySQL, PostgreSQL, and Microsft SQL Server.
- Url: the JDBC url to the database. Depending on the database type, URLs will look like the following:
- Driver: the type of driver; you can choose it from the options available in the drop down:
- Username: the username to access the database
- Password: the password to access the database
- Content: the SQL query
- Variable: the name of the variable that will store the results
The result of the query will be represented as an array where each item is a row.
Every row is a key/value map, as in:
Therefore, you can then iterate over the results to use them according to your needs.
To see another way to connect to a database using the API Fortress Helper Utility click here!