Home > database >  Getting The login is from an untrusted domain and cannot be used with Integrated authentication
Getting The login is from an untrusted domain and cannot be used with Integrated authentication

Time:09-12

I have a windows authentication user created on SQL server. I am trying to connect SQL server using that user, but I am getting java.sql.SQLException: The login is from an untrusted domain and cannot be used with Integrated authentication. error.

I am using jtds-1.3.jar. My connection url is jdbc:jtds:sqlserver://xyz.net:1433;instance=dev;databaseName=XYZ;integratedSecurity=true;useNTLMv2=true;domain=XYZ.net

I have checked the connection and traffic is allowed between my client machine and server. I tried setting intgratedSecurity= false as suggested in other answers but that did not work.

What properties of user should I check to know that user is correctly configured on SQL sever for JDBC connectivity?

CodePudding user response:

Finally, got this connection working. It turns out the best way to connect to SQL server using jTDS driver is to create SQL server user avoid creating windows user. And stick to SQL server based user.

  • Related