user6900728
user6900728

Reputation:

Getting error while connecting to the database[SOAP UI]

I have placed the mariadb driver in the SOAPUI_HOME/bin/ext directory. It says says no such property: sql for class

This is the code I tried:

//Below is just a sample
//Change values as needed in below connection
def driver = 'org.mariadb.jdbc.Driver'
def connectionString = 'jdbc:mariadb://localhost:3306/db'
def user = 'your_user'
def password = 'secret'
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver(driver)
def sql = Sql.newInstance(connectionString, user, password, driver)
def query = 'select * from company'
sql.execute(query)

Upvotes: 0

Views: 200

Answers (1)

albciff
albciff

Reputation: 18517

You're missing the import statement for Sql class, add the following import at the top of your script:

import groovy.sql.Sql

Upvotes: 1

Related Questions