Forum Discussion

al0's avatar
al0
Occasional Contributor
14 years ago

SoapUI fails to recognize JDBC drivers.

One of our SoapUI projects contains hte following Groovy script

import groovy.sql.Sql

// Skip groovy script if DB manipulations are not enabled
def isDBManipulationEnabled = context.expand( '${#Project#IS_DB_MANIPULATION_ENABLED}' )
if (!isDBManipulationEnabled.equals("true")) return;

def url = context.expand( '${#Project#DB_URL}' )
def driver = context.expand( '${#Project#DB_DRIVER_CLASS_NAME}' )
def user = context.expand( '${#Project#DB_USER}' )
def password = context.expand( '${#Project#DB_PASSWORD}' )

def MSG_EMPTY_ACTIVATION_KEY = "Empty activation key!"
def MSG_RECORD_NOT_FOUND = "Record not found!"


def activationKey = context.expand( '${CreateB2BContractDOI#Response#//cm30:CreateContractOutput[1]/cm30:CreateContractOutputContractChoice[1]/dom30:B2BContract[1]/dom30:ContractActivation[1]/dom30:activationKey[1]}' )

assert (activationKey!=""):MSG_EMPTY_ACTIVATION_KEY
if ( (null != url) && (null != driver) && (null != user) && (null != password) )
{
try {
connection = Sql.newInstance(url, user, password, driver)
context.setProperty("dbConn", connection)
}
catch (Exception e) {
log.error "Could not establish connection to the database. "+url+" : "+user+" : " +password+" : "+e.getMessage()
assert 1==2
}
}

which works nicely in SoapUI 3.0.1 but miserably fails in 4.0.1 with "No suitable driver found for jdbc:oracle:thin:@127.0.0.1:1521:ORCL".
The (same) ojdbc6.jar and ora18n.jar are located in bin/ext subdirectories of both soapui-4.0.1 and soapui-3.0.1.

Regards,
Oleksandr

1 Reply

  • al0's avatar
    al0
    Occasional Contributor
    Ok, it appears that ti is a known (mentioned somewhere in the forums) issue dating back to 3.5.
    Namely, drivers have to be put in lib/[/font:1unza2q1], not in bin/ext/[/font:1unza2q1]. In this case the code works OK.
    Anyway this change is not reflected in the documentation, http://www.soapui.org/JDBC/getting-started.html still states

    TestStep Properties Configuration

    For using the JDBC TestStep you will need to add a JDBC driver to soapui_home/bin/ext folder and restart the application.