JDBC sqlserver "Error establishing socket"
JDBC configuration statement: JDBC: Microsoft: sqlserver: // SERVER_NAME: 1433
If the "Error establishing socket" error occurs while running the program, perform the following debugging:
1. Check whether SQL Server allows remote access. Specific steps:
1) Open "Enterprise Manager", open the console root directory> SQL Server group> Database
2) Right-click the database and choose Properties"
3) Select the "connection" tab and check whether the RPC service is selected under "remote server connection.
2. Use the Telnet IP address 1433 to check whether the system prompts a connection error. If the system prompts an error
Check whether the firewall shields the network access port of SQL Server or Java ide
If yes, disable the firewall and restart SQL Server and Java IDE for testing,
If the system still prompts the preceding error, perform the following steps:
3. Check the SQL server port number and whether the TCP/IP protocol is enabled. The procedure is as follows:
1) Open "Enterprise Manager", open the console root directory> SQL Server group> Database
2) Right-click the database and choose Properties"
3) Select the "General" tab and click "network configuration". If no "TCP/IP protocol" is enabled, add it
4) Select "TCP/IP protocol" and click "properties" to check whether the port number is 1433.
5) If the port number is 1433, change it to another port number, modify the JDBC connection statement, and change the port number to the newly enabled port number, such as JDBC: Microsoft: sqlserver: // SERVER_NAME: 1400 (assuming the new port number is 1400)