how to load driver jar file to connect to database
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023
07:42 AM
03-03-2023
07:42 AM
how to load driver jar file to connect to database
Hello All,
request you to please suggest how to load an external driver .jar to connectc to database, as i have have required access to add any files or modify any existing files from the c:\ drive (were the SoapUI is installed)
thanks in advance
3 REPLIES 3
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2023
11:06 PM
03-03-2023
11:06 PM
try this
def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context ) def classpathHacker = new com.eviware.soapui.support.ClasspathHacker () log.info "utils=" + groovyUtils path = groovyUtils.getProjectPath() myfile = new java.io.File(path + "/ojdbc14.jar") mystring = "file://" + path + "/ojdbc14.jar" log.info "myfile=" + myfile classpathHacker.addFile( myfile ) com.eviware.soapui.support.ClasspathHacker.addFile( myfile ) com.eviware.soapui.support.ClasspathHacker.addURL( new URL(mystring) ) import groovy.sql.* def sql = groovy.sql.Sql.newInstance( db, userid, password, 'oracle.jdbc.driver.OracleDriver' )
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-04-2023
02:45 AM
03-04-2023
02:45 AM
i have tried this approach and im encountring the below error ,
java.io.IOException: Error, could not add URL to classloader jdk.internal.loader.ClassLoaders$PlatformClassLoader error
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2023
08:21 PM
03-05-2023
08:21 PM
looks like issue with the java version.
don't you have access SmartBear\SoapUI-5.6.0\bin\ext folder ?
