cancel
Showing results for 
Search instead for 
Did you mean: 

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

Occasional Contributor

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?

 

java.lang.classNotFoundExceptionSmiley Surprisedracle.jdbc.driver.OracleDriver

 

import groovy.sql.*
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("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)
log.info "DB connection ready

 

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

 

2 REPLIES 2
Contributor

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

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

 

for connection string I am using below convention - 

 

jdbc:oracle:thin:@ServerName:Port/TnsName

 

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

 

hope this solution works!

Occasional Contributor

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

Thanks!!. the solution worked for me.

New Here?
Join us and watch the welcome video:
Watch the new Interview
Top Kudoed Authors