Friday, May 20, 2016

JDBC for MS SQL Server with Window Authenetication

Window Authentication requires the user name, password, and domain.   It took me sometime to find a solution.

1. Use the JTDS driver
It is a freeware
2. Use "net.sourceforge.jtds.jdbc.Driver" as the driver class name
3. Use a connection string like this:  jdbc:jtds:sqlserver://<hostname>:1433/<db name>;domain=<domain.net>","<user>","<password>"

The key is that the connection string needs to include the domain.





Post a Comment