Forum Discussion

aditya55's avatar
aditya55
New Contributor
12 years ago

Unable to connect to MS SQL Server using jtds driver

Hi,

I am trying to connect to MS SQL server using jdbc driver.

e.g.

import groovy.sql.Sql

def sql = Sql.newInstance(DatabaseURL,'username', 'password', 'com.microsoft.jdbc.sqlserver.SQLServerDriver')

I have also tried

def sql = Sql.newInstance(DatabaseURL,'username', 'password', 'net.sourceforge.jtds.jdbc.Driver')

but I keep getting

for com.microsoft.jdbc.sqlserver.SQLServerDriver' :

2013-10-08 19:13:25,292 ERROR [errorlog] java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver
java.lang.ClassNotFoundException: com.microsoft.jdbc.sqlserver.SQLServerDriver

or for net.sourceforge.jtds.jdbc.Driver:

java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver:

I recently upgraded to soapui 4.5.2 pro and net.sourceforge.jtds.jdbc.Driver was working in previous verison.

do I need to do anything different for 4.5.2? I have included jtds driver in my ext folder . For com.microsoft.jdbc.sqlserver.SQLServerDriver I read online that it ships with soapui.

Regards,
Adi

7 Replies

  • SiKing's avatar
    SiKing
    Community Expert
    aditya55 wrote:
    I recently upgraded to soapui 4.5.2 pro and net.sourceforge.jtds.jdbc.Driver was working in previous verison.

    Did you remember to copy the jar files from OLD_SOAPUI_HOME/bin/ext to NEW_SOAPUI_HOME/bin/ext?
  • SiKing's avatar
    SiKing
    Community Expert
    aditya55 wrote:
    I recently upgraded to soapui 4.5.2 pro and net.sourceforge.jtds.jdbc.Driver was working in previous verison.

    aditya55 wrote:
    Yes I have copied latest jtds driver to bin/ext

    Are the above two the same version?
    Try
    com.microsoft.sqlserver.jdbc.SQLServerDriver
  • aditya55's avatar
    aditya55
    New Contributor
    thanks for your reply but I got the solution .

    I had to use below to register the driver. Not sure why i did not need to use below for previous version.

    GroovyUtils.registerJdbcDriver("net.sourceforge.jtds.jdbc.Driver");
  • SiKing's avatar
    SiKing
    Community Expert
    Don't know if you noticed, but the -Pro version has a JDBC test step that all that stuff for you.