com.microsoft.sqlserver.jdbc.SQLServerException:The TCP/IP connection to the host localhost, port 1433 has failed. Error:Connection refused: connect. Please verify the connection properties and checkthat a SQL Server instance is running on the host and accepting TCP/IPconnections at the port, and that no firewall is blocking TCP connections tothe port.
解决方法:
1.打开SQL Server配置管理器,在左侧双击SQL Server网络配置
2.在SQL Server的协议中,这时会看到右侧TCP/IP的状态被禁用了,开启即可!
3.重新启动一下SQL Server。