I've been trying to get a java application connecting via the jtds jdbc to a couple of SQL servers. I have to connect via windows authentication.
The connection string specified is:
String connectionString = _"jdbc:jtds:sqlserver://"+server+":"+port+"/"+database+";domain="+domain;_
and I am getting the connection via:
con = java.sql.DriverManager.getConnection(url, _username, _password);
This works fine on my SQL Server 2000 but not on the SQL Server 2005. On my SQL Server 2005, I get the following error message:
java.sql.SQLException: Login failed for user ''. The user is not associated with a trusted SQL Server connection.
Looks a bit funny to be because the user in the exception is blank, but the username specified in the parameter was not blank.
I have a feeling it might be something to do with NTLM and Windows authentication because it works when I try to log using SQL authentication (ie.without the domain property)