title: Login failed for user '' while connecting to SQL Server 2005 through windows authentication from Java
body: <p>I get this error when trying to connect to SQL Server.</p>
  
  <p>Error is:</p>
  
  <pre><code>Login failed for user ''. The user is not associated with a trusted SQL Server connection.
  </code></pre>
  
  <p>Server resides remotely. From my localhost I am trying to connect using this URL:</p>
  
  <pre><code>"jdbc:sqlserver://serverName:portNo;integratedSecurity=true;databaseName=myDB"
  </code></pre>
  
  <p>But when I use the msSQL studio tool to connect to sql server doing windows authentication, it connects me without any error.</p>
  
  <p>What is the difference in two cases?</p>
  
  <p>Any help is appreciated.</p>
  
  <p>Thanks</p>