With Microsoft SQL Database Server 2000 you can choose either of the two security (authentication) modes, namely:
- NT security mode (Windows NT Authentication only),
- Mixed mode (Windows NT Authentication and SQL Server Authentication).
NT security mode (Windows NT Authentication only):
It is related to windows domain. Access will be given to existing domain user account.Using those credentials, user can access the database.Separate account is not created as in other databases.
Mixed mode (Windows NT Authentication and SQL Server Authentication)
In these modes, both domain accounts and database accounts can be used to access the database.
JDBC drivers available for Microsoft SQL Database Server 2000:
1. JTDS Driver
JTDS driver works in both NT security mode and mixed mode.
2. Microsoft SQL Server JDBC Driver
MS SQL server JDBC driver works in mixed mode only.
Connection strings used for NT security mode using JTDS driver:
Ex:
con = java.sql.DriverManager.getConnection(”jdbc:jtds:sqlserver://servernaem or IP address:port no/database name;user=domain username;password=password;domain=Domain name”);
This string works in both windows and non-windows. This is not ntlm authentication method.
or
con = java.sql.DriverManager.getConnection(”jdbc:jtds:sqlserver://servernaem or IP address:port no/database name;”);
This method uses NTLM authentication. So NTLMauth.dll has to be copied to the system path. [ It is available along with JTDS driver. ]
Trouble shooting:
- Login failed for user: XXX
- Login failed for user: Null
The above errors occur, when you try to access the ms sql database from remote machines or applications.
- User doesn’t have access to the database.
2. You may be trying to access the database using database account and ms sql server might have been set to NT security mode.
3. User is accessing the database from windows domain account and he has access to it. But still getting error message means, he didn’t implement NTLM method correctly or didn’t give correct credentials. Please check the connection strings given in above section.
For any questions or issues, leave comments here.
Tags: ("jdbc:jtds:sqlserver://servernaem or IP address:port no/database name;user=domain username;password=password;domain=Domain name");, Connection strings used for NT security mode, Connection strings used for NT security mode using JTDS driver:, JDBC Driver, JTDS Driver, Microsoft SQL Server, Microsoft SQL Server JDBC Driver, Mixed mode, MS SQL Server 2000 authentication modes, NT security mode, NTLM Authentication, SQL Server Authentication, Trouble shooting Login failed for user, Trouble shooting Login failed for user: Null, User doesn’t have access to the database, Windows NT Authentication