Skip to main content

Configure database connection for data-driven testing in Katalon Studio

This document gives you information on which database can be used for data-driven testing and how to set up a database connection in Katalon Studio.

Note:
  • From Katalon Studio version 8.0.0 onwards, MySQL JDBC driver is removed from Katalon Studio built-in libraries. To continue using it, you can refer to this document: Implement DDT with MySQL.

Database connection settings

To do data-driven testing with a database, you can define a database connection that can be used for the whole project and override this global configuration in a test data file later.

To set up a global database connection, go to Project > Settings > Database.

The configuration includes the following fields:

  • Secure User and Password: Select to authenticate the connected database server, disabled by default
  • User: The username for authentication in the connected database server
  • Password: The password for authentication in the connected database server
  • JDBC Driver: The ClassDriverName of the database that has a supported library connection (JDBC)
  • Connection URL: The connection string of the database server. Katalon Studio supports built-in JDBC Drivers for the following databases:
  • Set Connection Properties for JDBC Driver (available from version 8.6.5): Set the desired connection properties for your JDBC driver (if any). The properties are applied for built-in drivers and external JDBC driver. To learn about the supported connection properties, see Connection properties recognized by Oracle JDBC Drivers.

You can set up a connection to one of the three databases with its executable jar file already embedded. Refer to the following table for an availability check:

Built-in DatabaseVersionKatalon Studio 7.0.0+Katalon Studio 7.5.0+Katalon Studio Enterprise 7.0.0+Katalon Studio Enterprise 7.5.0+
PostgreSQLv42.2.17
Oracle SQLv12.1.0.2
SQL Serverv6.2.2

In case you want to use a version other than the version those built-in drivers are compatible with, learn more about excluding built-in libraries.

If you want to connect to an external database having a JDBC (Java Database Connectivity) driver, you need to install its executable jar file accordingly then tell Katalon Studio where to use it for connection.

Connect to a database with a built-in driver

  • You have already set up your Postgre database.

  • Postgre database is running.

The following example shows you how to connect to a Postgre database that can be used in a whole project.

  1. Go to Project > Settings > Database.
  2. In Database:
    1. Select Secure User and Password to enable User and Password fields.
    2. Input the User and Password used for authentication.
    3. Enter Connection URL.
    4. Add Connection Properties for JDBC Driver if any.
    5. Click Test Connection to verify whether your database is connected successfully.Connect Database with a built-in driver
  3. Click Apply and Close to save your setting.

Connect to a database with an external JDBC driver

This section demonstrates how to set up the connection to a database with an external JDBC driver.

  • You have already set up an external JDBC driver.

  • The external JDBC driver is running.

  • An active Katalon Studio Enterprise license.

  1. Download the executable .jar file of the external JDBC driver. For example, to connect to the MariaDB Java Client driver, download the executable .jar file of the MariaDB library from the Maven Repository website: MariaDB Java Client.
    Note:
    • From Katalon Studio version 8.2.5 onwards, you can connect with the SAP HANA JDBC driver. Download the executable .jar file of the SAP HANA library in the Maven Repository website here: SAP HANA JDBC Driver.
  2. Go to Project Settings > Library Management. Click Add to add the jar file to the external library.
    Add an external JDBC driver
  3. In Project Settings, go to Database to configure the database connection.
    1. Select Secure User and Password to enable User and Password fields.
    2. Input the User and Password used for authentication.
    3. Enter Connection URL.
    4. Add Connection Properties for JDBC Driver if any.
    5. Click Test Connection to verify whether your database is connected successfully.Connect an external JDBC driver
  4. Click Apply and Close to complete the connection process.