ajinaniyan
New Contributor II

The main difference was that the failing one was a named instance (hostname\instancename) instead of just hostname. After trying different connection string variations and confirming traffic hit the server through the firewall, we found the root cause the SQL Server was configured to use dynamic ports but also had a specific port defined in the network configuration. Once we used the actual listening port in the JDBC string, the connection worked perfectly. If anyone else runs into this, check the SQL Server Network Configuration for the correct port and use it directly in your JDBC URL. Tools like Stellar Repair for MS SQL can help if you suspect database corruption while troubleshooting connectivity.