question

Jaytee29 avatar image
Jaytee29 asked

Application getting error when connecting using Availability Group Listener

Getting the below error when application trying to connect using AG Listener thru JDBC.

Here is the connection string "jdbc:sqlserver://AGListener:1433;databaseName=test;


com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host AGListener, 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 that TCP connections to the port are not blocked by a firewall."

When application trying to connect using IP and port 1433 they can connect without issue.



availability-groups
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
anthony.green avatar image
anthony.green answered

Add MultiSubnetFailover=True to the connection string.

Verify you can ping the registered IP addresses

Verify you can telnet or use PowerShell TNC cmdlet to test access over port 1433 to the IPs registered.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.