com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
Expert tip

If you're not using yet, consider using the SQLServerDataSource to set your server configurations. Also, check if the server is accepting TCP/IP connections and if there's no firewall blocking the connections.

Solutions on the web

via microsoft.com by Unknown author, 2 years ago
The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect
via microsoft.com by Unknown author, 2 years ago
The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect
via microsoft.com by Unknown author, 1 year ago
The TCP/IP connection to the host  has failed. java.net.ConnectException: Connection refused: connect
via bigresource.com by Unknown author, 1 year ago
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
via bigresource.com by Unknown author, 2 years ago
The TCP/IP connection to the hosthas failed. java.net.ConnectException: Connection refused: connect
via bigresource.com by Unknown author, 1 year ago
The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host has failed. java.net.ConnectException: Connection refused: connect
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.loginWithoutFailover(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at undefined.connectURL.main(connectURL.java:43)

Users with the same issue

4 times, 1 month ago
Once, 3 months ago
6 times, 5 months ago
4 times, 6 months ago
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.