How to perform Database Testing using Katalon Studio

This is a companion discussion topic for the original entry at

I’m new to Katalon testing and started with DB testing

I created 3 keyword (modified) so as it can connect to my SQL server DB with trusted connection.

  1. def connectDB - connects as expected

Created the keyword executeQuery


def executeQuery(String queryString) {

		 Statement stm = connection.createStatement()
		 ResultSet rs = stm.executeQuery(queryString)
		 while (
		 System.out.println(rs.getString("ZIP_CD") + " " + rs.getString("COUNTY_NM"));
 // Handle any errors that may have occurred.
		 catch (SQLException e) {
  1. def executeQuery - it gives me following error:
    :x: Cannot invoke method createStatement() on null object

Q: Is it weird that when I execute the a testcase it briefly opens Chrome which is by default ? (Although it’s DB test)
Is the issue related due to browser ?



Issue I’m getting is at connection.createStatement()
Cannot invoke method createStatement() on null object

Please share your thoughts, views.

where did


move too? It can’t resolve now in latest 7.0.4 version

They seemed to have resolved it to

import java.sql.Connection

So it now joins the other imports such as

import java.sql.DriverManage

import java.sql.ResultSet

import java.sql.Statement

It took me a while to figure this out and get my test running again so hopefully, they can update their Documentation to remove the call for [ import com.mysql.jdbc.Connection ]


1 Like

yes its resolved to java.sql.Connection

I am getting error while creating db connection object in Katalon Studio 7.3, Earlier the script was working fine in Katalon Studio 6.3.3. Please refer below for the error message:
SQL CMD Exception: Check for Syntax ErrorUnknown system variable ‘performance_schema’/null

private static Connection connection = null;

def connectDB(String server, String port, String dbname, String username, String password){
	String url = "jdbc:sqlserver://" + server + ":" + port + ";databaseName=" + dbname + "integratedSecurity=true"
	//";user=" + username + ";password=" + password

	if(connection != null && !connection.isClosed()){
	connection = DriverManager.getConnection(url)
	return connection

getting this esxeption:
java.sql.SQLException: No suitable driver found for jdbc:ABC-EFG-D01\CSTSFC11T:1433;databaseName=XYZ;user=AC;password=1234@Pass;
at java_sql_DriverManager$ Source)
at New Test Case (1).run(New Test Case (1):39)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
at com.kms.katalon.core.main.TestCaseExecutor.runScript(
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
at com.kms.katalon.core.main.TestCaseExecutor.execute(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain.runTestCase(
at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

i am getting the following error Groovy:unable to resolve class com.mysql.jdbc.Connection. can anyone help

Hi, All

Can we please get an updated example of how to do this? Coping and pasting the old example code is no good as it has errors in the current version.


how do we establish a connection to ClickHouse database server

By reading the docs, see: