SQL Server JDBC URL format for the Database Change Data Capture

SQL Server JDBC URL format for the Database Change Data Capture

book

Article ID: KB0072685

calendar_today

Updated On:

Products Versions
TIBCO Streaming 10.6 and later

Description

I have JDBC HOCON configuration for a SQL Server JDBC data source, which uses the JDBC URL format:
 
jdbc:sqlserver://myDBhost\\myDBInstance

This works fine, and allows me to successfully connect to my SQL Server data source using the Streaming JDBC Query operators. However, the same URL format does not work for the Database Change Data Capture adapter, where it fails:
INFO  InputAdapter: Failed to connect to database 'jdbc:sqlserver://myDBhost\\myDBInstance'" 
WARN  InputAdapter: Adapter is shutting down: The connection to the host myDBhost, 
named instance \myDBinstance failed. Error: "java.net.SocketTimeoutException: Receive timed out". 
Verify the server and instance names and check that no firewall is blocking UDP traffic to port 1434.  
For SQL Server 2005 or later, verify that the SQL Server Browser Service is running on the host.

Issue/Introduction

Outlines a known syntax issue that will reveal itself when using the Database Change Data Capture adapter for SQL Server.

Resolution

In this case, use a single backslash instead to avoid the error:
 
jdbc:sqlserver://myDBhost\myDBInstance

In a JDBC HOCON configuration, the single backslash needs to be escaped by a preceding backslash. But for the Database Change Data Capture adapter, this is not needed.