Tuesday, March 27, 2012

Connection Problem

Hi All,
I use the following code lines for connecting to SQL Server 2005 using
JDBC in Java:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
String connectionUrl =
"jdbc:sqlserver:// SERVER;user=USER;databaseName=db;Authent
icationMethod=auto
";
but I got the error: Login failed for user 'USER'
I want to use windows authentication and I am pretty sure I use the
correct username. Can you please help me?
Thanks a lot.AuthenticationMethod=auto is correct but you would not
supply a user in the connection string to have the
connection use Windows authentication. If you supply the
user, it will use SQL authentication, not windows.
-Sue
On 9 Oct 2006 00:56:14 -0700, "sara" <sarasara82@.gmail.com>
wrote:

>Hi All,
>I use the following code lines for connecting to SQL Server 2005 using
>JDBC in Java:
>Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> String connectionUrl =
>"jdbc:sqlserver:// SERVER;user=USER;databaseName=db;Authent
icationMethod=aut
o";
>but I got the error: Login failed for user 'USER'
>I want to use windows authentication and I am pretty sure I use the
>correct username. Can you please help me?
>Thanks a lot.

No comments:

Post a Comment