Forum Discussion

OOTesting's avatar
OOTesting
Occasional Contributor
14 years ago

SOAPUI Registering & checking SQL DB connection in SOAPUI

Hi all, new to SOAPUI. Currently using the SOAPUI (not pro) and would like to know how to register and validate DB connection to SQL server. Added MS JDBS for SQL to C:\Program Files\eviware\soapUI-4.0.0\bin\ext (sqljdbc4) and restarted SOAPUI.

Then used the following connection details:

com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc:sqlserver://<IP>:1433;databaseName=lbconsole;user=sa;password=angel77;

Then attempted to select test connection, which failed to provide any information, please advise as to where I'm going wrong?

Do I have to setup the property for the connection with all the fields of the table?
Is there a way I can check the connection externally to validate the connection details?
Do I have configure preferences of SOAPUI beforehand?

2 Replies

  • Run a Groovy script step to register your JAR file each time you open SoapUI before you try to connect to any database. Once you've run the Groovy step, you won't have to do it again for that SoapUI session. Then test your connection.

    Here's the Groovy for the script step.


    import groovy.sql.Sql
    com.eviware.soapui.support.GroovyUtils.registerJdbcDriver( "com.microsoft.sqlserver.jdbc.SQLServerDriver" )


    This will at least get you beyond the dread "failed to init connection" error. I use jTDS so I can't help you with the connection string. You might want to consider jTDS because you don't have to embed a password in your connection string; performance is also (supposedly) better.
  • OOTesting's avatar
    OOTesting
    Occasional Contributor
    I made a schoolbiy error in that I failed to use the correct jar files, now downloaded the correct jar files and works brillantly.