cancel
Showing results for 
Search instead for 
Did you mean: 

No suitable driver found for jdbc:sqlserver

SOLVED
Community Expert

No suitable driver found for jdbc:sqlserver

Hi all.
I have struggled through this for two days previously. Now I am at another client, and it seems I am destined to repeat the same mistakes.

I am running SoapUI 3.6.1. I tried both the x32 and x64 versions with the exact same results. When it starts up, it reports:

Thu Jun 30 14:17:45 PDT 2011:INFO:Adding [C:\Program Files (x86)\eviware\soapUI-3.6.1\bin\ext\sqljdbc4.jar] to extensions classpath
...
Thu Jun 30 14:17:47 PDT 2011:INFO:Used java version: 1.6.0_21

Tried both versions from Microsoft for sqljdbc4.jar.

FYI:

echo %JAVA_HOME%
C:\Program Files (x86)\eviware\soapUI-3.6.1\jre


When I execute the following:

import groovy.sql.Sql

def sqlInstance = Sql.newInstance(
"jdbc:microsoft:sqlserver://vsqlgmsdb01:1433;databaseName=PatronExtension;",
"user",
"password",
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
)

I get: "Thu Jun 30 14:18:00 PDT 2011:ERROR:An error occured [No suitable driver found for jdbc:sqlserver://vsqlgmsdb01:1433;databaseName=PatronExtension], see error log for details".
I don't know if the stack trace is helpful to anybody:

Thu Jun 30 15:04:34 PDT 2011:ERROR:java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://vsqlgmsdb01;databaseName=PatronExtension;
java.sql.SQLException: No suitable driver found for jdbc:microsoft:sqlserver://vsqlgmsdb01;databaseName=PatronExtension;
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at groovy.sql.Sql.newInstance(Sql.java:273)
at groovy.sql.Sql$newInstance.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:132)
at Script4.run(Script4.groovy:3)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


After spending a day Googling, I tried all the following with the exact same results:

  1. jdbc:sqlserver: instead of jdbc:microsoft:sqlserver:

  2. not including the driver: com.microsoft.sqlserver.jdbc.SQLServerDriver

  3. removing the default port 1433

  4. server IP instead of hostname

  5. sqljdbc.jar instead of sqljdbc4.jar, and both of them

  6. What did I do wrong?

    TIA for any advice.
1 ACCEPTED SOLUTION

Accepted Solutions
Community Expert

Re: No suitable driver found for jdbc:sqlserver

The secret "make this work switch" is:

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

briefly mentioned here: http://www.soapui.org/Scripting-Propert ... ovy-script
10 REPLIES 10
Frequent Contributor

Re: No suitable driver found for jdbc:sqlserver

def jdbc_connection = context.expand( '${#Project#jdbc}' ) //( jdbc:sqlserver://127.0.0.1:1433;databaseName=testdb;user=test;password=test)
def jdbc_driver = context.expand( '${#Project#jdbc_driver}' ) //(com.microsoft.sqlserver.jdbc.SQLServerDriver)
sql = Sql.newInstance(jdbc_connection, jdbc_driver)

Does the trick for me....
Community Expert

Re: No suitable driver found for jdbc:sqlserver

Not working for me. I tried every variation from groovy.codehaus.org, but nothing seems to be working.
I suspect that there is something wrong with loading the jar, but I am not sure how to prove that, and what to do abotu fixing it.
Community Expert

Re: No suitable driver found for jdbc:sqlserver

Maybe I just proved it. I tried changing my connect string to:

def sqlInstance = Sql.newInstance(
"blah.blah.blah",
"user",
"password",
"com.microsoft.sqlserver.jdbc.SQLServerDriver"
)

And I still get the exact same error. So something is wrong with loading the driver, but what and how do I fix it?
Frequent Contributor

Re: No suitable driver found for jdbc:sqlserver

Have you added the .jar to the intalldir/bin/ext?
Community Expert

Re: No suitable driver found for jdbc:sqlserver

The secret "make this work switch" is:

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

briefly mentioned here: http://www.soapui.org/Scripting-Propert ... ovy-script
New Contributor

Re: No suitable driver found for jdbc:sqlserver

Wonderful! Just in case this helps this answer get found by anyone else searching, this also works for the oracle.jdbc.driver.OracleDriver.

cheers.
Occasional Contributor

Re: No suitable driver found for jdbc:sqlserver

Great it worked for me Thanks!

com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.OracleDriver")

Frequent Visitor

Re: No suitable driver found for jdbc:sqlserver

I'm facing the same issue. Where do I need to update the below?

com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.OracleDriver")

Regular Visitor

Re: No suitable driver found for jdbc:sqlserver

Where i have to add the above line?

New Here?
Join us and watch the welcome video:
Watch the New Interview
7Mistakes
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win