Connecting to MsSql through JDBC

I was not able to connect to MsSql using JDBC. I was using the host with the port no. like:

jdbc:jtds:sqlserver//localhost:3683/TestDB

I would always get “Connection refused” exception.

Then I chucked out the port no. from the host name, and it works fine now.

jdbc:jtds:sqlserver://localhost/TestDB

Leave a Reply

Your email address will not be published. Required fields are marked *