Cannot Connect to Sql Server Database Using JDBC

I am trying to connect to an existing database in SQL Server 2012n using Netbeans 8.

Using the connection wizard, I select Sql Server 2012 and enter the credentials and fields.

However, I get a message about the impossibility of establishing a connection.

You can see screenshots of the entered fields:

Sql server

Netbeans connection wizard

I also tried using "localhost" instead of "STIJN", this did not work. I also tried using the default port "1433". Also did not work, no matter what port it is? Where can I see which port I use? Perhaps the error lies in the port, otherwise I do not know where I made a mistake.

+6
source share
1 answer

Go to your SQL Server configuration manager → SQL Server Network Configuration → Protocols for SQLEXPRESS → TCP / IP (double click on it for properties).

On the protocol page page, Yes is enabled. On the IP Addresses page, scroll down. Dynamic TCP ports: 54629 TCP port: 1433 Apply and approx.

Make a connection with: Host: localhost Port: 1433 Your credentials Instance field = empty.

That should work.

+12
source

Source: https://habr.com/ru/post/984354/


All Articles