title: Migrating from jTDS JDBC driver to Microsoft JDBC
body: <p>Microsoft has recently released a new JDBC driver (version 6.0.7507.100) with some very interesting features. I am mostly interested in the TVP feature. This is why I would like to replace the current jTDS driver with the Microsoft driver.</p>
  
  <p>The problem arises when trying to log in to our production server. Lets say we use the domain user "mydomain\dbuser" to login to the sql server instance. This is the jtds jdbc url we have used so far:</p>
  
  <pre><code>jdbc:jtds:sqlserver:/sqlServer:1433/myDb;domain=mydomain;user=dbuser;password=secretPwd
  </code></pre>
  
  <p>It works like a charm.</p>
  
  <p>But when I try to use the Microsoft driver, my application cannot establish a connection to the database. I tried the following URL strings:</p>
  
  <pre><code>jdbc:sqlserver://sqlServer:1433;database=myDb;username=dbuser;password=secretPwd
  jdbc:sqlserver://sqlServer:1433;database=myDb;username=mydomain\dbuser;password=secretPwd
  jdbc:sqlserver://sqlServer:1433;database=myDb;username=dbuser@mydomain;password=secretPwd
  </code></pre>
  
  <p>and many other permutations but with no success. The app fails with the following exception:</p>
  
  <pre><code>com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user 'mydomain\dbuser'
  </code></pre>
  
  <p>in the SQL Server log we get the following error:</p>
  
  <pre><code>Login failed for user 'mydomain\dbuser'. Reason: Attempting to use an NT account name with SQL Server Authentication. [CLIENT: 10.10.10.10]
  </code></pre>
  
  <p>Note that the application is supposed to run under Linux. </p>
  
  <p>Does anybody know how the Microsoft JDBC URL should look like when connecting as a domain user?</p>