title: How to connect to Remote MS SQL Database using Windows Authentication of Remote Desktop in Java?
body: <p>I'm trying to connect to a MS SQL database from my machine using Java. </p>
  
  <p>Generally, I login to a remote desktop and connect to the database using Windows Authentication of the remote desktop.</p>
  
  <p>I tried using JTDS</p>
  
  <pre><code>  "jdbc:jtds:sqlserver://&lt;database server&gt;;"
          + "user=&lt;domain&gt;\&lt;username&gt;;password=&lt;password&gt;"
  </code></pre>
  
  <p>But that returned with login failure error. 
        <em>"java.sql.SQLException: Login failed for user 'domain\username'."</em></p>