The “Connection refused” exception is thrown by jTDS when it is unable to connect to the server. There may be a number of reasons why this could happen:
1. The server name is misspelled or the port number is incorrect.
2. SQL Server is not configured to use TCP/IP. Either enable TCP/IP from SQL Server’s Network Utility app
3. There is a firewall blocking port 1433 on the server.
To check whether TCP/IP is enabled and the port is not blocked you can use “telnet <server_host> 1433”. Until telnet doesn’t connect, jTDS won’t either. If you can’t figure out why, ask your network administrator for help.
If you make any changes, remember to restart the Apache Tomcat service for the change to be effected