I need to connect to High Availability (HA) / Desaster Recovery (DR), also known as HADR, enabled SQL server 2012 using AD account from Java on Linux.
integratedSecurity
is not an option since it runs on Linux- I can not use the jTDS JDBC driver since it does not support HADR cluster (no support for
multiSubnetFailover=true
)
jTDS actually works with username, password and domain connection string parameters, but times out 25% of the time.
So it seems I'm stuck with MS SQL JDBC driver but I can't make it work with just the username/password credentials, as I'm trying to solve this without Kerberos.
It must be possible to do it (in theory), since jTDS can actually do it!
I found that driver version 6.0 has property authentication=ActiveDirectoryPassword
so it looked very promising, but a SQL connection string like
jdbc:sqlserver://server:port;database=DB;authentication=ActiveDirectoryPassword;username=name;password=PASSWORD
even trying with DOMAIN\username
for username or user property, isn't working.
The docs says its for
using an Azure AD principal name and password
but it would just make my life so much easier.
The error I get is
Login failed for user ''
and shows empty user, but stepping through the decompiled code I can see the username and password values are being loaded into variables.
Any solution for this? I take any AD username/password connection to HADR SQL server 2012 that is pure JAVA.