Have you ever encountered such an error?
The TCP/IP connection to the host localhost, port 1433 has failed.
- 1
com.microsoft.sqlserver.jdbc.SQLServerException:
The TCP/IP connection to the host localhost, 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.".
- 1
- 2
- 3
- 4
- 5
Solution:
1. Select This Computer –> Right-click Management –> Computer Management –> Services and Applications
(1) First check sql server
whether the service has been started
Go to –>SQL Server Configuration Manager –>SQL Server Service to ensure that the local Sql Server
service has been started.
(2) Check sql server
the network configuration again
and go to –> SQL Server Configuration Manager –> SQL Server Network Configuration to ensure Named Pipes
that TCP/IP
the protocol is enabled.
2. We run the program again, and the connection may still fail. Continue to solve the problem: still
see sql server
the network configuration
to –> SQL Server Configuration Manager –> SQL Server Network Configuration, Named Pipes
and TCP/IP
the protocol is enabled, select TCP/IP
the right button – >Properties–>IP Address, scroll down and check IPALL
whether TCP端口
it is 1433. If not, change it to 1433 1433
.
Finally, restart SQL Server
the service and then run the program again. It is successful and comfortable!
What I use is: jdk1.7
(corresponding resources will be posted tomorrow)
database driver jar package and jdk1.7 download
Have you ever encountered such an error?
The TCP/IP connection to the host localhost, port 1433 has failed.
- 1
com.microsoft.sqlserver.jdbc.SQLServerException:
The TCP/IP connection to the host localhost, 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.".
- 1
- 2
- 3
- 4
- 5
Solution:
1. Select This Computer –> Right-click Management –> Computer Management –> Services and Applications
(1) First check sql server
whether the service has been started
Go to –>SQL Server Configuration Manager –>SQL Server Service to ensure that the local Sql Server
service has been started.
(2) Check sql server
the network configuration again
and go to –> SQL Server Configuration Manager –> SQL Server Network Configuration to ensure Named Pipes
that TCP/IP
the protocol is enabled.
2. We run the program again, and the connection may still fail. Continue to solve the problem: still
see sql server
the network configuration
to –> SQL Server Configuration Manager –> SQL Server Network Configuration, Named Pipes
and TCP/IP
the protocol is enabled, select TCP/IP
the right button – >Properties–>IP Address, scroll down and check IPALL
whether TCP端口
it is 1433. If not, change it to 1433 1433
.
Finally, restart SQL Server
the service and then run the program again. It is successful and comfortable!
What I use is: jdk1.7
(corresponding resources will be posted tomorrow)
database driver jar package and jdk1.7 download