Connecting to MsSql through JDBC

Posted by {"name"=>"Palash Ray", "email"=>"paawak@gmail.com", "url"=>"https://www.linkedin.com/in/palash-ray/"} on July 21, 2008 · 1 min read

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