Hi All,
I have the following weird problem when trying to connect to MSSQL 2005 database using JDBC and windows authentication.
I am using the following command:
DriverManager.getConnection("jdbc:sqlserver://<<MACHINE IP>>:;database=<<DB NAME>>;integratedSecurity=true;","<<DOMAIN USER NAME>>","<<DOMAIN USER PASSWORD>>")
and I get the following exception:
com.microsoft.sqlserver.jdbc.SQLServerException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
I tried to google this exception but all I can see is similar one but the exception also contain the user name. Please note that in the exception I get, the user name is not listed..
I also checked it with various connection strings (I also tried to put the user name and password in the connection string, using the parameters 'user' and 'password'), but I always get the same result.
Also, when I used SQL authentication I am able to connect to the SQL (after I remove the 'integratedSecurity' param).
The SQL server is configured to work with both SQL and Windows authentication- I am able to log in to the SQL (with Microsoft SQL server management studio express) with the same windows user.
The sqljdbc_auth.dll is also located in the class path.
Does anyone have any idea what I am doing wrong?
Thanks,
Uri