Jdbc Connection Failed, Error: Tcp/Ip Connection to Host Failed

The TCP/IP connection to the host localhost, port 1433 has failed error, need assistance

Have you enabled 'Named Pipes' and 'TCP/IP'?

  1. Open the 'Sql Server Configuration Manager' application.

  2. In the left pane, go to 'SQL Server Network Configuration' -> 'Protocols for [instance-name]'

  3. Right-click on both 'Named Pipes' and 'TCP/IP' and select 'enable'.

Have you used the correct port?


  1. Double-click on 'TCP/IP'

  2. Select 'IP Addresses' tab

  3. Scroll to IPAII. Your port number is here.




  1. Restart the 'SQL Server ([instance-name])' windows service.

The TCP/IP connection to the host, port 1433 has failed

Copy computer name :cmd.exe -> hostname

or

Right Click on Start then click on System and copy the Computer Name

URL should be:

String url = "jdbc:sqlserver://<Computer Name>\\SQLFULL:1433;databaseName=BA_ELTRUN;";

Connection conn = DriverManager.getConnection(url,"<user>","<password>"):


Related Topics



Leave a reply



Submit