1
votes

I am trying to setup jmeter for sql server. Getting following error

Response message: java.sql.SQLException: Cannot create PoolableConnectionFactory (The TCP/IP connection to the host localhost, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall.".)

java -version
java version "1.8.0_91"
Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)

Environment variable set to:

CLASSPATH
C:\Program Files\Microsoft JDBC Driver 6.2 for SQL Server\sqljdbc_6.2\enu\mssql-jdbc-6.2.2.jre8.jar

Copied file mssql-jdbc-6.2.2.jre8.jar to C:\JMeter\apache-jmeter-3.3\lib\

JMETER setting:

DatabaseURL:jdbc:sqlserver://localhost:1433;databaseName=TestDb;integratedSecurity=true; jdbcClassDriver: com.microsoft.sqlserver.jdbc.sqlserverdriver

2
-1 without reason, wow. It takes nothing to click, but takes few keystrokes to explain reason. If you can't explain why, post cannot be improved.Shantanu Gupta
I didn't downvoted, did you put the driver in the right case: com.microsoft.sqlserver.jdbc.SQLServerDriver?user7294900
Have you followed the instructions in the exception message? If not, please do that first.Mark Rotteveel
@user7294900 Yes, I selected it from dropdownlist for class driver. MarkRotteveel, I have checked, sql server is connecting using ssms and i checked TCP/IP is enabled.Shantanu Gupta

2 Answers

0
votes

This setting resolved the issue: DatabaseURL:jdbc:sqlserver://localhost:1433;databaseName=TestDb;integratedSecurity=true;jdbcClassDriver: com.microsoft.sqlserver.jdbc.sqlserverdriver

rest was fine, when i have added integratedSecurity=true parameter, it worked perfectly fine.

Thanks

-3
votes

Make sure you have the appropriate validation query selected in JDBC Connection Configuration.