- 20 Mar 2024
- 3 Minutes to read
- PDF
Connection Strings
- Updated on 20 Mar 2024
- 3 Minutes to read
- PDF
The parameters of a connection string can change depending on the version of the database engine or driver. Reference your database provider's documentation for the correct connection string syntax if you do not see it listed here.
Overview
Connecting a data source to Validatar is done using connection strings. It specifies information about the data source and the means of connecting to it.
The connection string you use depends on the database engine you're connecting to, the chosen Validatar connection type, and whether or not you decide to use Windows Authentication.
Always encrypt your password using the placeholder [[PASSWORD]] in the connection string and typing your password in the provided password box.
Validatar uses three different connection types: SQL Server, ODBC, and OLE DB.
Connecting using SQL Server
Use the SQL Server connection type to connect to SQL Server and Azure SQL databases. Note: Windows comes with the SQL Server driver already installed.
To escape any special characters (semicolons, single-quote character, double-quote character):
- The value must be enclosed in double quotation marks.
- If the value contains both a semicolon and double-quote character, the value must be enclosed in single quotation marks.
SQL Server Authentication
Server=myServerAddress;Database=myDatabase;User Id=myUsername;Password=[[PASSWORD]];
Windows Authentication
Integrated Security specifies that you are using Windows Authentication. User credentials are not required. When using Integrated Security, acceptable values are 'true', 'false', 'yes', or 'no'.
Server=myServerAddress;Database=myDatabase;Integrated Security=yes;
Validatar uses the service (domain) account Validatar is running under for Windows Authentication not the current user's domain credentials. Check with your web server admin and database admin to verify that the Validatar service account has read-access to the databases you want to connect to via Windows Authentication.
Connecting to a SQL Server Instance
If there are multiple instances on the server, you must identify the instance name in the connection string.
Server=myServerName\myInstanceName;Database=myDatabase;User Id=myUsername;Password=[[PASSWORD]];
Specifying a Port
You can specify the port number after the server name.
Server=myServerName,portNumber;Database=myDatabase;User Id=myUsername;Password=[[PASSWORD]];
Synonyms
Some connection string keywords are interchangeable with other synonyms.
Keyword | Synonym(s) |
---|---|
Server | Data Source, Address, Addr, Network Address |
Database | Initial Catalog |
Integrated Security | Trusted_Connection |
Password | PWD |
User ID | UID |
Connecting using ODBC
The appropriate ODBC driver must be installed on the server before connecting to a data source. Be sure to use the correct driver name in the connection string.
Netezza
Driver={NetezzaSQL};Server=myServerAddress;port=myPortNumber;Database=myDataBase;username=myUsername;password=[[PASSWORD]];
Snowflake
Driver={SnowflakeDSIIDriver};Server=myServerAddress;Warehouse=myWarehouse;Database=myDatabase;Uid=myUserName;Pwd=[[PASSWORD]];
Optional parameters
- Schema
- Role
Make sure there are no spaces between the parameter value and semicolon in the connection string, or the connection will fail.
Oracle
The simplest way to connect to an Oracle database is to create a system DSN on the server. The user must have admin rights to create a system DSN.
- Open ODBC Data Sources 64-bit in Windows
- Click the System DSN tab
- Click Add
- Select the Oracle ODBC driver
- Fill out all relevant information
- Create the DSN
dsn=dsnName; Uid=myUserName; Pwd=[[PASSWORD]];
PostgreSQL
Driver={PostgreSQL};Server=IP address;Port=5432;Database=myDataBase;Uid=myUsername;Pwd=[[PASSWORD]];
Teradata
DRIVER={Teradata Database ODBC Driver 16.20};DBCName=156.43.66.95;UID=username;PWD=[[PASSWORD]];
Connecting using OLE DB
The appropriate OLE DB driver must be installed on the server before connecting to a data source.
Netezza
Provider=NZOLEDB;Password=[[PASSWORD]];User ID=myUsername;Data Source=myServerAddress;Initial Catalog=myDataBase;Port=PortNumber;
Oracle
Oracle Provider
Provider=OraOLEDB;Data Source=MyOracleDB;User Id=myUsername;Password=[[PASSWORD]];
Microsoft Provider
Provider=MSDAORA;Data Source=MyOracleDB;User Id=myUsername;Password=[[PASSWORD]];
PostgreSQL
Provider=PostgreSQL OLE DB Provider;Data Source=myServerAddress;location=myDataBase;User ID=myUsername;password=[[PASSWORD]];
Teradata
Provider=TDOLEDB;Data Source=myServerAddress;User ID=myUsername;Password=[[PASSWORD]];
Troubleshooting Errors
Error | Possible Solutions |
---|---|
Invalid username or password | Verify the credentials by connecting to the database via DBMS or creating a DSN. If using Windows Authentication, check with your server admin and database admin that the service account Validatar is running under has permissions to the appropriate databases. |
Could not connect to the database server | If the timeout takes a couple of seconds this is probably an access issue. If the timeout takes a few more seconds this probably is a networking or firewall issue. Check with your networking team to ensure Validatar can connect to the database server. |
The connection string is incorrect | Verify that all required parameters for that database engine are included in the connection string. If you're connecting to Snowflake, be sure there are no spaces between the parameter value and semicolon as this will cause the connection to fail. |