Java 11th days

Source: Internet
Author: User

Today, I used my own Java example to connect to SQL Server and the result showed that the connection failed.

The error message is:

Com. Microsoft. sqlserver. JDBC. sqlserverexception: The TCP/IP connection to the host localhost through port 1433 fails. Error: "connection refused: connect. Verify the Connection Properties, check that the SQL server instance is running on the host, accept the TCP/IP connection on this port, and ensure that the firewall does not block the TCP connection to this port .".


Later, I finally learned the reason through my own thoughts and experiments, because the dynamic port is enabled in the TCP/IP service in the SQL Server service manager, you only need to clear all 0 in the dynamic port and fill in TCP/TP static port 1433.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.