Call class object, keyword object in test case

Hello guys,

I’m having a problem. I created a new package and I want to use somehow object in class. Here is my script also

package db_connection

import com.kms.katalon.core.annotation.Keyword

import groovy.sql.GroovyRowResult

class sample {

@Keyword
def getResource() {
SQLHandler sql = new SQLHandler()
List res = sql.getSelectResults(‘SELECT COUNT(*) as calls FROM test WHERE testAt IS NOT NULL AND test1At IS NULL’)
int countFromDb = res.get(0).get(‘Calls’)
println(“No. of rows in Database is(are):” + res.get(0))
return res.get(0)
}
} ----> That is a package and in Test case I call so: CustomKeywords.‘db_connection.sample.getResource’() and it works well. But now i want to reach countFromDb object to perform that action : if (countFromDb != rows_count)

Examples:
def row_cnt = CustomKeywords.‘db_connection.sample.getResource’()
def cnt = 0
if (row_cnt != cnt) {
do something
}

more info: https://stackoverflow.com/questions/53923276/how-to-make-new-database-keywords-in-katalon-studio-and-use-them/53926944?noredirect=1#comment94700476_53926944