0

I am getting the below error when my application tries to connect using AG Listener thru JDBC. Multisubnetfailover=true has been added to the connection string, but it is still not working.

TCP/IP connection to the host , port 1433 has failed. Error: "Listener": Name or service not known. 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.

When the application is trying to connect using the IP on port 1433, it is working.

Here is the connection string:

jdbc:sqlserver://Listener:1433;databaseName=test;MultiSubnetFailover=true
Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
Jaytee
  • 1
  • 1
  • It's hard to tell, because your connection string isn't shown in the question, but it seems like you have `instanceName=Listener;` in it. Is that the correct instance name? – AlwaysLearning Sep 24 '21 at 02:08
  • Sorry I just added a random AG Listener. For the instance name, i used the AG listener name with FQDN. – Jaytee Sep 24 '21 at 03:14
  • 1
    If it connects when using IP address but not when using a host name, either: 1) the host name is incorrect, 2) the DNS isn't resolving it, or 3) the client computer's DNS settings are using incorrect DNS server/s. – AlwaysLearning Sep 24 '21 at 03:33
  • Thanks. I'll ask the client. When I tried connecting to Listener using ODBC data source admin, it works fine when enabling the Multisubnet failover. – Jaytee Sep 24 '21 at 06:39

0 Answers0