I have set up two SQL server instance with IPs say x.x.x.x and y.y.y.y. On the application level when specifying connection to SQL server, can I specify the connection string as below
<connection-url>jdbc:sqlserver://x.x.x.x:port; databaseName=productionDB; failoverPartner=jdbc:sqlserver://y.y.y.y:port</connection-url>
I have tried to play around it and however when I manually disable SQL server 1 database, on the application level it seems like it is indeed trying to connect to second server but instead it fails with
connection to host y.y.y.y, port 1433 has failed. Error:" null. Verify the connection properties, Make sure that an instance of SQL server is running on the host and accepting TCP/IP connections at the port. Make sure the TCP connections to the port are not blocked by a firewall.
I know the connection properties such as user, password are all the same across two SQL instance because if I restart the application above with two IPs swapped everything still works. Also I know that failover Partner should only be used when database mirroring is set up. However, according to this article, it seems feasible without underlying mirroring database set up.