Fan soft connection FineReport SQL Server database is unsuccessful: connect to host localhost on port 1433 TCP / IP connection fails

When installing FineReport connect to SQL Server database, through port 1433 connected to the machine has failed in FineReport official web site, the document has not found a solution. After searching online for a long time, finally found the problem "need to enable SQL Server SQL Server network configuration protocol TCP / IP protocol", the solution will now be summarized as follows. [FineReport is written in Java, the essence of the problem is that "Java is connected via SQLServer JDBC"]

Problem Description: com.microsoft.sqlserver.jdbc.SQLServerException: localhost host connected to a TCP / IP connection failure via port 1433. Error: "Connection refused:. Connect Verify that the instance connection properties, and check the SQL Server is running on the host, and in this port accepts TCP / IP connections, make sure the firewall is not blocking this port TCP connections.".

at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:171)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLServerConnection.java:1033)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConnection.java:817)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerConnection.java:700)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:842)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.luoying.TestSQLServer2.main(TestSQLServer2.java:15)

Solution:

Open the "microsoft sqlserver" of the SQL Server Configuration Manager (Configuration Manager),

Check the SQL Server Network Configuration, the following have MSSQLSERVER agreement to the TCP / IP-enabled right.

View the next SQL Native Client configuration, the client protocol, to the TCP / IP-enabled right.

Ensure that the port is 1433, and has been opened.

Finally, the SQL Server (MSSQLSERVER) service is restarted!

--------------------------------------------

Attachment:

win10 find sql server configuration manager and open approach:

After installing sql server can not find the "sql server configuration manager (SQL server configuration manager) in the Start menu. Because SQL Server Configuration Manager is a Microsoft Management Console snap-in programs rather than a separate program, so when running Windows 10 when, SQL Server configuration Manager does not appear as an application. 

1) Right-click on the desktop, "this computer", select "Manage", then expand "Services and Applications" to see SQL Server Configuration Manager.

2) or Explorer, locate the directory: C: \ Windows \ SysWOW64, and find this directory  SQLServerManager14.msc (sql server 2017 corresponding to other versions of sql server corresponding to the modification) file, double-click the file to open "Explorer."

3) or directly run cmd, enter "SQLServerManager10.msc", can directly open the "Explorer"

 ------------------------------------

Another turn:

Java via JDBC SQLServer 2012, some connection problems, find a lot of solutions from the Internet, but still can not solve. Here I encountered the problems and solutions are summarized below, hope you can help.

1, connected to the host by localhost port 1433 TCP / IP connection fails. Error: "Connection refused:. Connect Verify that the instance connection properties, and check the SQL Server is running on the host, and in this port accepts TCP / IP connections, make sure the firewall is not blocking this port TCP connection.

2, connected to the host by localhost port 1433 TCP / IP connection fails. Error:. "Connect timed out Verify that the instance connection properties, and check the SQL Server is running on the host, and in this port accepts TCP / IP connections, make sure the firewall is not blocking this port TCP connection.

NOTE: The first error: Connection refused: connect, verified the TCP / IP port problem, solutions may be concentrated in the step (1) (2) (3) (5).

      The second error: connect timed out, after a solution (1) (2) (3) verify that the error will also occur after the port is correct, it is Ortega step (4), modify the firewall settings, perfect to solve the problem .

 solution:

(1) Open the SQLServer Configuration Manager -------> SQLServer for MSQLSERVER -------> TCP / IP -------> If it does not, start ------ -> right properties -------> IPAddresses -------> IP All -------> the TCP port to 1433;

(2) Open SQLServer Configuration Manager -------> SQL Native Client 10.0 Configuration -------> CP / IP -------> If it does not, then the start ---- ---> right properties -------> the default port (default port) was changed to 1433;

(3) restart the server.

(4) If the database connection fails, check the firewall. ------- Control Panel> System and Security -------> Windows Defender Firewall -------> should be allowed to enable or disable Windows Defendddeer Firewall -------> Windows will firewall is turned off.

 (5) the perfect solution to connection problems

----------------
Summary:

java programming has encountered a problem: to host a TCP / IP connection fails. java.net.ConnectException:Connectionrefused:connect
In the case of the environment are all new configuration, even when a database error, the first reaction is not open database service did not open. Then the firewall, and finally IPALL set to 1433.
SQL SERVER appears unable to connect (or can not connect via IP), most of it for several reasons:

1. The service is not open

2. The firewall blocks the port (usually port 1433)

3. does not allow remote access. The outer vessel is provided with a configuration application "allow remote access"

4.TCP / IP protocol based on IP options set TCP / IP remote connection is not correct (usually incorrectly IP, or to fill in but not enabled)

5. "ALL listening", but is not set to "IPAll" TCP port number.

 

Guess you like

Origin www.cnblogs.com/wotainanle/p/12497649.html