Skip to main content
Version: current

Set up database connection for data-driven testing 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 MySQL.

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

Introduce database connection in Katalon Studio

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.

Database settings

Where:

  • 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:

You can set up a connection to one of those three database types 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.

For those who wish 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 in Katalon Studio

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

Important:
  • You have already set up your Postgre database.

  • Postgre database is running.

To establish a connection, go to Project > Settings > Database. In Database:

  1. Select Secure User and Password to enable User and Password.
  2. Input User name and Password used for authentication and Connection URL.
  3. Click Test Connection to verify whether your database is connected successfully.

    Connect Database with a built-in driver

  4. Click Apply and Close to save your setting.

Connect to a database in Katalon Studio with an external JDBC driver

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

Important:
  • You have already set up an external JDBC driver.

  • The external JDBC driver is running.

  • An active Katalon Studio Enterprise license.

To start the connection:

  1. Download the executable .jar file of the external JDBC driver. For example, we want to connect to the MariaDB Java Client driver. We download the executable .jar file of the MariaDB library from the Maven Repository website here: 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 to Add the jar file > click Apply.

    Add anexternal JDBC driver

  3. In Project Settings, go to Database:

    • Select Secure User and Password to enable User and Password.
    • Input User name and Password used for authentication and Connection URL.
    • Enter JDBC Driver.
    • Enter Connection URL.
    • Click Test Connection to verify whether your database is connected successfully.

      Connect an external JDBC driver

    • Click Apply and Close to complete the connection process.

Next: See Manage Test Data.