Forum Discussion

sclavell's avatar
sclavell
Occasional Contributor
9 years ago
Solved

No suitable driver for jdbc after upgrade from SoapUI Pro to Ready API

I recently upgraded from SoapUI Pro 5.1.2 to Ready API 1.5.0.  I often use groovy to make MS SQL connections to run queries and update statements.  After updating to Ready API, all of my groovy scripts are giving the error "No suitable driver found for jdbc:sqlserver://[my database]. I kept my SoapUI Pro install, so I can run either SoapUI or Ready API.  My groovy scripts still work fine in SoapUI Pro.

 

I've tried copying the sqljdbc.jar file from the SoapUI\bin\ext folder to the Ready API\bin\ext folder.  I've tried downloading the latest sqljdbc.jar file from Microsoft.  I restart Ready API after each time I change the jar file.  I've checked the JDBC settings in the Preferences.  Everything looks correct. 

 

I'm stumped.  Anyone have any ideas?

  • I found a fix.  I have to register the driver first at the top of my groovy script.

     

    com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( "com.microsoft.sqlserver.jdbc.SQLServerDriver" )

     

    Still makes me wonder if there's a configuration setting missing somewhere in my Ready API installation, since I don't appear to need this line when running my scripts in SoapUI Pro.

3 Replies

  • sclavell's avatar
    sclavell
    Occasional Contributor

    I see this in the Ready! API log when I launch the program:
    Wed Dec 09 10:39:25 MST 2015:INFO:Adding [C:\Program Files\SmartBear\ReadyAPI-1.1.0\bin\ext\sqljdbc.jar] to extensions classpath

     

    This is what I see in the Error Log when I run my groovy script:
    Wed Dec 09 10:34:25 MST 2015:ERROR:java.sql.SQLException: No suitable driver found for jdbc:sqlserver://myserver:1433
    java.sql.SQLException: No suitable driver found for jdbc:sqlserver://myserver:1433
    at java.sql.DriverManager.getConnection(Unknown Source)
    at java.sql.DriverManager.getConnection(Unknown Source)
    at groovy.sql.Sql.newInstance(Sql.java:402)
    at groovy.sql.Sql.newInstance(Sql.java:446)
    at groovy.sql.Sql$newInstance.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:149)
    at Script1.run(Script1.groovy:14)
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:92)
    at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:76)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:155)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:263)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

     

    Here's the line from my groovy script:
    def sqlServer = Sql.newInstance("jdbc:sqlserver://myserver:1433", userid, password, "com.microsoft.sqlserver.jdbc.SQLServerDriver")

     

    I appreciate any help you can give.

  • sclavell's avatar
    sclavell
    Occasional Contributor

    I found a fix.  I have to register the driver first at the top of my groovy script.

     

    com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( "com.microsoft.sqlserver.jdbc.SQLServerDriver" )

     

    Still makes me wonder if there's a configuration setting missing somewhere in my Ready API installation, since I don't appear to need this line when running my scripts in SoapUI Pro.