This document explains how to connect to SQL Server using the jTDS driver and NTLM authentication.
NTLM (NT LAN Manager) is a suite of Microsoft security protocols that provides authentication, integrity, and confidentiality to users.
The jTDS driver from SQL Server allows the user to connect to a database using NTLM authentication instead of using the normal SQL Server authentication.
The URL format for jTDS is:
where <server_type> is one of either 'sqlserver' or 'sybase', <port> is the port the database server is listening to and <database> is the database name (if not specified, the user's default database is used).
There are different properties that can be used but the important ones for NTLM authentication are the following:
- User name to use for log in.
- Password to use for log in.
- Specifies the Windows domain for authentication:
- If specified and the username and password are provided, jTDS uses Windows (NTLM) authentication instead of the usual SQL Server authentication (i.e. the user and password provided are the domain user and password). This allows non-Windows clients to log into servers which are only configured to accept Windows authentication.
- If the domain parameter is present but no username and password are provided, jTDS uses its native Single-Sign-On library and logs in with the logged Windows user's credentials.
- useNTLMv2 (default - false):
- Set to true to send LMv2/NTLMv2 responses when using Windows authentication.
JTDS URL format