How to specify port in JDBC connection URL for failoverPartner server in SQL Server
<p>I'm trying to add a server as a failover for SQL Server and it is not using the port <code>1443</code>, I'm using the port <code>2776</code>. I'm trying to specify it but everything I tried didn't work. How could I do that?</p>

<pre><code>private String url = "jdbc:sqlserver://server1:2776;DatabaseName=db;failoverPartner=server2";
</code></pre>

<p>I've tried the following configs, but none of them worked.</p>

<ol>
<li><code>...failoverPartner=server2:2776</code></li>
<li><code>...failoverPartner=server2,2776</code></li>
<li><code>...failoverPartner=server2\\db</code></li>
</ol>

<p>But everytime I get exception.</p>

<blockquote>
  <ol>
  <li><p>com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2, port 1433 has failed. Error: "connect timed out. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".</p></li>
  <li><p>com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2:2776, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".</p></li>
  <li><p>com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host server2, 2776, port 1433 has failed. Error: "null. Verify the connection properties, check that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".</p></li>
  </ol>
</blockquote>