You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

If you connect to a SQL Server with a native MS SQL JDBC Driver the following error possibly occurs:

com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host HOSTNAME, 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.

Problem 1

Most of the times the problem is exactly as stated in the Exception text. The given Port for your connection has to be allowed in the firewall settings.

Problem 2

Sometimes this error occurs because of the TCP/IP configuration in the Sql Server Configuration Manager Console.

  • Open the Sql Server Configuration Manager Console.
  • Expand the SQL-Server Network Configuration item in the tree on the left side.
  • Right click on the TCP/IP entry on the left side.
  • Click on the tab for the IP adresses
  • Scroll down to the IPAll configuration
    • Make sure that the configuration of TCP DynamicPorts is empty
      • sometimes it is preconfigured with a value 0 or a value above 50000
    • Make sure that the correct port number for the connection is configured for the TCP Port

 
  • No labels