1

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

Shantanu Gupta
  • 20,688
  • 54
  • 182
  • 286
  • I didn't downvoted, did you put the driver in the right case: `com.microsoft.sqlserver.jdbc.SQLServerDriver`? – Ori Marko Nov 09 '17 at 09:47
  • Have you followed the instructions in the exception message? If not, please do that first. – Mark Rotteveel Nov 09 '17 at 09:54
  • @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 Nov 09 '17 at 09:58
  • See https://stackoverflow.com/questions/18841744/jdbc-connection-failed-error-tcp-ip-connection-to-host-failed – Ori Marko Nov 09 '17 at 10:41

2 Answers2

-1

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

Sameer
  • 93
  • 1
  • 8
-3

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