I extracted the file and added both sqljdbc.jar and sqljdbc4.jar (individually) but whenever I try to test the connection I get the following error message:
com.eviware.soapui.support.SoapUIException: Failed to init connection for driver [com.microsoft.sqlserver.jdbc.SQLServerDriver], connectionString [jdbc:microsoft:sqlserver://HOSTNAME\SQLExpress:3306;databaseName=MYDB;user=USER&password=PASS]
I checked the SoapUI log and the drivers are being loaded. For example:
Mon Dec 05 08:08:21 PST 2016:INFO:Adding [C:\Program Files\SoapUI-5.2.1\bin\ext\sqljdbc.jar] to extensions classpath
According to the error log, it seems that the driver loaded isn’t the correct one:
Mon Dec 05 08:35:48 PST 2016:ERROR:java.sql.SQLException: No suitable driver
Obviously I’m doing something wrong here. Can someone help to me to understand where I’m making the mistake? If it helps, the db connection works (checked with MS SQL Server Manager) and I was able to connect to a MySQL db using SoapUI (different db though).
Thanks for reading and I appreciate any advice you may have!
com.eviware.soapui.support.SoapUIException: Failed to init connection for driver [MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDrive], connectionString [jdbc:sqlserver://localhost\sqlexpress;databaseName=DataVision;user=admin;password=admin]
The driver is missing an r at the end (again the JDBC Driver List page is wrong) and you don’t need MSSQL(MicrosoftDriver)/ at the start.
Try
com.microsoft.sqlserver.jdbc.SQLServerDriver
Also copy sqljdbc4.jar to C:\Program Files\SmartBear\SoapUI-5.2.1\bin\ext
Originally posted by wujianyy on December 07, 2016
Another solution is to use groovy script. You can use Windows Authentication to access sql server database.
Notice of extra jar and dll:
1 The files of JDBC driver(MSSQL(MicrosoftDriver)/com.microsoft.sqlserver.jdbc.SQLServerDrive) isn’t distributed with SoapUI Free version. .jar and .dll must be copied into the folder of Soapui folder.
sqljdbc_auth.dll must be copied to ..\SoapUI-5.2.1\bin\
sqljdbc42.jar must be copied to ..\SoapUI-5.2.1\lib.
Originally posted by divergentor on December 09, 2016
Thank you guys for help.
Now everything is ok and I can work with my local DB.
If you don’t mind I keep my steps here, maybe it can help somebody.
If you are using local DB
Put sqljdbc4.jar file to the directory C:\Program Files\SmartBear\SoapUI-5.2.1\lib. Do not use version sqljdbc41.jar and sqljdbc42.jar. (They do not work for some reason for me.)
Turn on SQL server browser
Go to the SQL server configuration/ choose SQL server network configuration and set TCP/IP enable
Restart the SQL server
In the test case create a JDBC step with properties
Driver
com.microsoft.sqlserver.jdbc.SQLServerDriver
Connection Sting (example)
jdbc:sqlserver://localhost\sqlexpress;databaseName=DataDB;user=admin;password=admin
com.eviware.soapui.support.SoapUIException: Failed to init connection for driver [com.microsoft.sqlserver.jdbc.SQLServerDriver], connectionString [jdbc:sqlserver://databaseserver/instance;databaseName=test;integratedSecurity=true]
2)Turn on SQL server browser
4) Go to the SQL server configuration/ choose SQL server network configuration and set TCP/IP enable
5) Restart the SQL server
still cannot connect . Any suggestions ?
Can’t get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: The server version is not supported. The target server must be SQL Server 2000 or later.
For integrated authentication to work you’ll need sqljdbc_auth.dll matching your environment
(32bit / 64bit) in your library path . Download and place it under C:\Program Files (x86)\SmartBear\soapUI-5.2.1\lib
The issue was with placing the files in correct folders (sqljdbc & auth.dll files).
But I am facing another issue now
When I provide connection string with username & password combination, Soap UI throws the following error :
“Can’t get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ‘username’.”
And when I provide connection string with the Integrated Security setup, the followihng error comes up.
"Can’t get the Connection for specified properties; com.microsoft.sqlserver.jdbc.SQLServerException: This driver is not configured for integrated authentication. "
Note :
I have sqljdbc4.jar & sqljdbc_auth.dll file in SoapUI-5.2.1\lib folder .
I have mysql-connector-java-5.1.41-bin and sqljdbc4.jar in ext folder
Unzip the sqljdbc_4.0.2206.100_enu.exe file contents to a new folder.
Copy sqljdbc4.jar (but not sqljdbc.jar) to SoapUI-5.2.1\bin\ext
Make sure you copy the correct sqljdbc_auth.dll from either x64 (for 64 bit) or x86 folder to SoapUI-5.2.1\bin
This has always worked for me using Win7, but if Test Connection still fails then try removing any other files except sqljdbc4.jar from SoapUI-5.2.1\bin\ext