SQL Datasource can not connect to database on JBoss Fuse Services Works 6

Solution Verified - Updated -

Environment

  • Red Hat JBoss Fuse Services Works 6
  • Red Hat JBoss EAP 6

Issue

  • Can't connect to database
  • Log file show the follow message:
"*** SQLException:ConnectionID:1 com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host servername, port 62959 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.". The TCP/IP connection to the host servername, port 62959 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".

Resolution

It is very important that the URL jdbc connection includes the fully qualified domain hostname, in order to ensure the correct name resolution as follows:

jdbc:sqlserver://servername.example.com:1521;instanceName=instanceName;databaseName=databaseName

Root Cause

Some environments are not prepared to recognize short names from DNS servers. In order to ensure the correct connection to database it is recommended to use database fully qualified domain name (FQDN) or its IP address.

Diagnostic Steps

  • Create a new datasource using server short name
  • Test connection using CLI or JBoss web console

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments