Skip to content

Connection strings

Every source and destination connects through ODBC: an ODBC data source (DSN) defined on the Replicator Service's computer, or an ODBC driver with a connection string that you enter in the Data Replicator Manager. Which drivers SQDR installs and which you install: ODBC drivers.

Microsoft Fabric, Kafka and S3 Tables destinations have no ODBC connection: they're described on the wizard's Connector step (see The Connector step).

ODBC DSN or ODBC Driver

The method can't be changed after the source or destination is created.

Method What you provide When to use it
ODBC DSN A data source defined with the ODBC administrator (or odbc.ini) on the Replicator Service's computer. All connection options live in the DSN. When DSNs are already set up and managed there, or a driver is configured only through its DSN dialog.
ODBC Driver A driver and a connection string. Nothing is defined outside the Data Replicator Manager. Most new sources and destinations: the whole definition is in one place, and templates help you start.

The driver and data source lists

The lists show what's installed on the Replicator Service's computer (for the SQDR container, inside the container), not on your browser's computer:

  • ODBC DSN: if the Replicator Service runs as the local system account, only system DSNs are listed; if it runs as a user account, that user's DSNs are listed too.
  • Both lists show only drivers the Replicator Service supports. To list every driver, set the service property addUnsupportedDrivers (see Service properties).
  • With a DBMS Type chosen on the Name step (other than Other), the ODBC Driver list shows only the drivers that have a template for that database.

A driver installed after the page was opened appears when you reopen the wizard.

How the connection string is used

To connect, the Replicator Service builds the full ODBC connection string:

  • ODBC DSN: DSN= and the data source name.
  • ODBC Driver: DRIVER={driver name}; followed by your ODBC Driver Connection String.

It then adds the login settings of the Authentication Method: the user ID and password for Remote Credentials, Trusted_Connection=Yes for Use Integrated Security, nothing for Connection String (driver-specific) (see Authentication). So put UID or PWD in the connection string only with Connection String (driver-specific). For some drivers it also adds options it relies on, unless your string sets them, for example NO_CACHE=1 for MySQL and MariaDB sources and DELIMIDENT=Y for sources using the IBM Informix driver.

Write the connection string as keyword=value pairs separated by semicolons, with the keywords of the driver's documentation. For the keywords each database needs, start from a template and see the database's page.

Authentication

The Authentication Method says how the Replicator Service signs in to the database, and what it adds to the connection string for that.

Method How it connects Use it when
Remote Credentials With the User ID and Password you enter: the Replicator Service adds UID= and PWD= to the connection string. The password is stored encrypted in the control database. The database uses its own accounts, or the Replicator Service's account has no access to it.
Use Integrated Security As the account the Replicator Service runs under (Windows login), without a password: the Replicator Service adds Trusted_Connection=Yes unless the connection string already has it. SQL Server with Windows authentication, when the Replicator Service runs under a domain account with access to the database.
Connection String (driver-specific) With whatever the connection string or the DSN says: the Replicator Service adds no user ID, password or Windows login setting. Write the driver's own login keywords, including the user (for example UID=), and keep keys, passphrases and tokens in secrets. The driver signs in another way, such as a key file, a key pair or a token: for example Snowflake with a key pair or a token (see Snowflake key-pair and token authentication), or BigQuery with a service-account key file (Email and KeyFilePath in the connection string).

The method works with an ODBC DSN and an ODBC Driver connection string alike. A DSN doesn't choose the method: most DSNs don't store a password, and still need Remote Credentials. Sources and destinations from an earlier version keep their method when you upgrade. BigQuery and Snowflake key-pair destinations set up with Use Integrated Security keep working; Connection String (driver-specific) describes what they actually do, and doesn't add Trusted_Connection=Yes.

If an ODBC DSN is configured for integrated security but Remote Credentials is selected, the test fails with "ODBC DSN is configured to use Integrated Security, but "Remote Credential" Authentication Method is selected".

The user needs permissions for what the Replicator Service does: reading the replicated objects on a source, and creating and filling tables on a destination. Database-specific permissions are on each destination's page and, for sources, in the Prepare the database section of each source's page (see Databases).

SQL Server: SQL Server login or Windows authentication? Decide while you plan. A SQL Server login (Remote Credentials) is the simpler setup, and needs the server in mixed mode ("SQL Server and Windows Authentication mode"). Windows authentication (Use Integrated Security) connects as the Replicator Service's Windows account: give that account access to each database (see Integrated Security), and check the Object Schema of new destinations, which may default to the Windows user name rather than a schema that exists, such as dbo (see Defaults). Each source, destination and the control database chooses its own method: the Replicator Service can reach its control database with Windows authentication and a destination with a SQL Server login, or the other way round. To create or upgrade a SQL Server control database with the SQDR Configuration Tool, Stelo recommends a login (or Windows user) in the sysadmin server role (see SQDR Configuration Tool).

Secrets in connection strings

To keep a password, key or token out of the connection string, store it as a secret in the Replicator Service and refer to it as $$name$$. For example, a Snowflake key pair whose passphrase is in the secret SNOWFLAKE_KEY_PWD, with Connection String (driver-specific) authentication:

SERVER=myaccount.snowflakecomputing.com;DATABASE=MYDB;WAREHOUSE=MYWH;ROLE=MYROLE;UID=MYUSER;AUTHENTICATOR=SNOWFLAKE_JWT;PRIV_KEY_FILE=C:\keys\rsa_key.p8;PRIV_KEY_FILE_PWD=$$SNOWFLAKE_KEY_PWD$$

For the whole setup, see Snowflake key-pair and token authentication.

The Replicator Service replaces each reference with the secret's value when it sets up the connections, connection tests included. A reference to a secret that doesn't exist is left as is, so the driver usually rejects the connection. To create and change secrets, see Secrets. Secrets also work in an Apply extension's parameters (see Default Parameters).

Testing the connection

Verify opens a connection with the settings as entered, without saving them. For an existing source or destination, while the connection is the saved one, a blank Password means the saved password; after you change the connection, enter the password to verify it.

Next and Save don't run this test. But when the Replicator Service needs the database's settings, it connects and stops with the driver's error if it can't, and nothing is saved: when you save a new source or destination without Advanced (see What happens when you save), and, for an existing one, when you save a changed connection or switch from Basic to Advanced after changing it.

Fix the connection string, data source or credentials, and try again. The test only opens a connection; it doesn't check permissions on individual objects. Microsoft Fabric, Kafka and S3 Tables destinations have no connection to test: use Verify on their Connector step.

Connection strings by database

Each database's page shows its connection strings: the template, encryption (SSL/TLS), high availability and other options. Options the Replicator Service adds by itself (see How the connection string is used) don't need to be in your string.

Database Connection strings
Db2 for i As a source, as a destination
Db2 for LUW, Db2 for z/OS Db2 for LUW as a source, as a destination
SQL Server, Azure SQL As a source, as a destination
Oracle As a source, as a destination
MySQL, MariaDB As a source, as a destination
PostgreSQL As a source, as a destination
Informix As a source, as a destination
Amazon Redshift Redshift
Salesforce Salesforce
Text and CSV files Text and CSV files
Other databases The Connection step on the database's page under Databases