When running the Java application for the first time you may find that the following error occurs:
"The TCP/IP connection to the host localhost, port 1433 has failed. Error: Connection refused: connect. Please verify the connection properties and check that a SQL Server instance is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port."
There are various causes of this problem. One possibility is that TCP/IP is not enabled for your SQL Server configuration, in which case follow these instructions:
1. Start the SQL Server Configuration Manager, and then expand SQL Server Network Configuration.
2. Click Protocols for InstanceName, and then make sure TCP/IP is enabled in the right panel and double-click TCP/IP.
3. On the Protocol tab, notice the value of the Listen All item.
4. Click the IP Addresses tab:
- If the value of Listen All is Yes, the TCP/IP port number for this instance of SQL Server 2008 is the value of the TCP Dynamic Ports item under IPAll.
- If the value of Listen All is No, the TCP/IP port number for this instance of SQL Server 2008 is the value of the TCP Dynamic Ports item for a specific IP address.
5. Make sure the TCP Port is 1433.
6. Click OK.