Here’s how we are able to connect to Microsoft SQL Server using the jTDS JDBC driver. This is a local development environment using a newly installed SQL Server Express 2012.
1. Create the user with SQL Server authentication. Here we are using SQL Server Management Studio to create the new user “demo”.
2. Make sure SQL Server supports both Windows and SQL Server authentication. Here we are using SQL Server Management Studio.
3. Enable TCP/IP for the database instance. Here we are going to use the SQL Server Configuration Manager.
4. Start the SQL Browser service. Go to Control Panel -> Administrative Tools -> Services and start the SQL Server Browser.
5. Here are the JDBC parameters passed to jTDS.
url=jdbc:jtds:sqlserver://localhost:1433/MY_DATABASE;instance=MY_INSTANCE driver=net.sourceforge.jtds.jdbc.Driver user=MY_USERNAME password=MY_PASSWORD
Please replace the MY_ variables with your own values.