al0
14 years agoOccasional Contributor
SoapUI fails to recognize JDBC drivers.
One of our SoapUI projects contains hte following Groovy script
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
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