Sunday, March 25, 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.SQLSer verDriver");
String connectionUrl =
"jdbc:sqlserver://SERVER;user=USER;databaseName=db;AuthenticationMet hod=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.SQLSe rverDriver");
> String connectionUrl =
>"jdbc:sqlserver://SERVER;user=USER;databaseName=db;AuthenticationMet hod=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.
sqlsql

No comments:

Post a Comment