Use JDBC Drivers From Scripts

You can perform direct JDBC calls from Groovy scripts.

This topic describes how to use a Groovy script to register the JDBC driver and connect to the database.

Important

We recommend using the JDBC Request test step and JDBC data source instead of Groovy scripting.

Where to use

There are several ways to run this script:

Example

The following code demonstrates how to register the MySQL JDBC driver and connect to the database:

Important

Before registering the driver, you need to place its JAR file to the <ReadyAPI Installation>\bin\ext directory.

See Also

Publication date: