Forum Discussion

mohantysuchi's avatar
Occasional Contributor
7 years ago

getting class not found exception for oracle jdbc driver in groovy script

I am using groovy scripting in soap ui 5.3.0 to connect oracle DB and  getting the below error while running the script?




import groovy.sql.*"net.sourceforge.jtds.jdbc.Driver")
def connstr = context.expand('${#Project#groovy_connstr}')
def dbuser = context.expand('${#Project#db_user}')
def dbpassword = context.expand('${#Project#db_password}')
def oracledriver = context.expand('${#Project#OracleDriver}')

def sql = Sql.newInstance(connstr, dbuser, dbpassword, oracledriver) "DB connection ready


I have placed ojdbc14 and ojdbc6- in soap ui/bin/ext folder. can anyone help me this?


2 Replies

  • New2API's avatar
    Frequent Contributor

    Hi Mohantysuchi, try to drop ojbc6 jar in soapui/lib folder as well. 


    for connection string I am using below convention - 


    //## Establish ORACLE connection ##//
    def ConnStr = Sql.newInstance(Server, ua, pw, "oracle.jdbc.driver.OracleDriver")


    hope this solution works!