user284331
user284331

Reputation: 155

SQL Server with DB Visualizer

I know it may sound duplicate to other posts, but I have tried my best and still no luck.

The closest post that I found is the following: JDBC connection failed, error: TCP/IP connection to host failed

So my question is, I am using SQL Server 2022, and I am able to connect through SSMS, but if I want to use DBVisualizer to connect with it, then it fails.

As suggested in the aforementioned post, I did the following.

  1. I turn off the firewall, so firewall must not be an issue anymore.
  2. I did turn on the port, as the following picture shown.

enter image description here

  1. For the dynamic port, I did the following.

enter image description here

  1. As indicated in the post, somebody said that the dynamic port got to be the same with IPAll, I tried it, no luck.

  2. So my DBVisualizer looks like the following. And I did set encrypted: Optional and trustServerCertificate: true in the properties column.

enter image description here

  1. While my SSMS looks like the following. I am using Windows Authentication anyway.

enter image description here

enter image description here

enter image description here

Hope somebody helps, thank you for your time.

EDIT:

I am using jTDS, picture attached:

enter image description here

Upvotes: 1

Views: 151

Answers (2)

siggemannen
siggemannen

Reputation: 9159

There's no need to use the old hat jtds server in 2024. I installed db viz and followed the below procedure to create a windows auth connection:

  1. Double click on the sql server in the connection list
  2. Changed database to master, default was Northwind
  3. Under properties, you need to change:
  • encrypt to false (or fix the correct keys, which is a hassle)
  • integratedSecurity = true (this actives windows auth)
  • I didn't need it, but sometimes you also need trustServerCertificate = true
  • The url should look like jdbc:sqlserver://localhost:1433;databaseName=master

Driver settings

  1. Connect:

Final connection

Upvotes: 1

user284331
user284331

Reputation: 155

The user @AlwaysLearning already says it all:

First, go to download jTDS - SQL Server driver. Paste those files into the Driver Manager, picture attached:

enter image description here

You may need to create another User Drivers as it shall already have the default SQL Server by DBVisualizer, in my case, I make it like SQL Server-1.

Now the crucial part is to copy the ntlmauth.dll file from the downloaded folder (x64>SSO>ntlmauth.dll) to the correct path.

The correct path is: C:\Windows\System32. Restart the DBVisualizer, type the Database URL to be jdbc:jtds:sqlserver://127.0.0.1:1433/pubs, where pubs is the database to be replaced with, and you should be good.

PANIC SITUATION:

If I disconnect the SQL Server-1 and reconnect again, I will get the I/O error like I/O Error: SSO Failed: Native SSPI library not loaded. Check the java.library.path system property.

The way I overcome this difficulty is silly: simply close the DBVisualizer and open it again. Not sure if somebody can fix this panic situation.

Upvotes: 1

Related Questions