Hi All,

We have SQl Server 2016 database and I am able to connect using windows authtentication, but for application we are not able to use indivisual user id and password, In my company we have created systema ccounts and for those accounts are part of active directory group, Now From my machine through Java I am trying to connect DB with service account but its fials withe below error.

Error while creating database connection: java.sql.SQLException: Login failed. The login is from an untrusted domain and cannot be used with Windows authentication.

Connection Details:- databaseUrl = "jdbc:jtds:sqlserver://" + host + ":" + port + "/" + dbName + ";instance=XXXXXXX;domain=YYYYYYY;useNTLMv2=true";

conn = DriverManager.getConnection(databaseUrl, userName, password);

Please help us to reolve this