title: I can't make the sqljdbc work with AD username/password
body: <p>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.</p>
  
  <ul>
  <li><code>integratedSecurity</code> is not an option since it runs on Linux</li>
  <li>I can not use the jTDS JDBC driver since it does not support HADR cluster (no support for <code>multiSubnetFailover=true</code>)</li>
  </ul>
  
  <p>jTDS actually works with username, password and domain connection string parameters, but times out 25% of the time.</p>
  
  <p>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.</p>
  
  <p>It must be possible to do it (in theory), since jTDS can actually do it! </p>
  
  <p>I found that driver version 6.0 has property <a href="https://msdn.microsoft.com/en-us/library/ms378988(v=sql.110).aspx" rel="nofollow noreferrer"><code>authentication=ActiveDirectoryPassword</code></a> so it looked very promising, but a SQL connection string like</p>
  
  <pre><code>jdbc:sqlserver://server:port;database=DB;authentication=ActiveDirectoryPassword;username=name;password=PASSWORD
  </code></pre>
  
  <p>even trying with <code>DOMAIN\username</code> for username or user property, isn't working. </p>
  
  <p>The docs says its for </p>
  
  <blockquote>
    <p>using an Azure AD principal name and password</p>
  </blockquote>
  
  <p>but it would just make my life so much easier. </p>
  
  <p>The error I get is </p>
  
  <blockquote>
    <p>Login failed for user ''</p>
  </blockquote>
  
  <p>and shows empty user, but stepping through the decompiled code I can see the username and password values are being loaded into variables. </p>
  
  <p>Any solution for this? I take any AD username/password connection to HADR SQL server 2012 that is pure JAVA.</p>