Environment: SQL Server 2008 R2 + myeclipse 6.5 + JDK 1.6.24
Problem:
Java connects SQL Server 2008 through JDBC with the following problem: TCP/IP connections to host 127.0.0.1 via port 1433 failed. Error: "Connect timed out." Verify the connection properties and check that instances of SQL Server are running on the host and that the TCP/IP connection is accepted on this port, and that the firewall does not block TCP connections to this port.
Solve:
1. Open SQL Server Configuration Manager------->sqlserver for msqlserver------->tcp/ip-------> If it is not started, start-------> Right-key property------->ipaddresses------->ip all-------> Change TCP port to 1433;
2. Open SQL Server Configuration Manager------->sql Native Client 10.0 Configuration------->CP/IP-------> If it is not started, start-------> Right-key property-------> change default port to 1433;
3. Control Panel-------> System and Security------->windows FireWall (Windows firewall)------->turnwindows FireWall on or off-------> Shut down Windows Firewall.
4. Perfect solution.