I configured my SQL Server (2005) to do dual authentication. I can connect to my database using MS SQL Server Management Studio both as SA
and my other login (Custcompass). In my java program, I can also connect as SA, but I can't connect as my other login. I'm using a jdbc driver I downloaded from Microsoft. Here's the code:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
//Fails with SQLState=S0001, vendorCode=18456, detailMessage="Login failed for user 'Custcompass'."
String connectionUrl = "jdbc:sqlserver://localhost:1434;databaseName=custCompass;user=Custcompass;password=xyz;";
Connection con = DriverManager.getConnection(connectionUrl);
//Works
String connectionUrl = "jdbc:sqlserver://localhost:1434;databaseName=custCompass;user=sa;password=abc;";
Connection con = DriverManager.getConnection(connectionUrl);
I'm new to use SQLServer from java, so it could be something stupid on my part. Any ideas?
Thanks.
Steve