Connecting via ODBC Drivers
  • 08 May 2022
  • 5 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Connecting via ODBC Drivers

  • Dark
    Light
  • PDF

Note:

This topic applies to users who want to migrate from the desktop ElastiCube Manager Manager to Sisense on the web.

Open Database Connectivity

The ODBC provider allows access to a data source via an installed driver on the operating system regardless of the architecture of the data source.

Because Sisense is now a browser-based application, running on Java, it is recommended that you work with the Sisense Generic JDBC connector, rather than with the Generic ODBC connector. For more information, see Connecting to JDBC . If you need to use ODBC over a Sisense Linux installation, you can use the ODBC connectivity from Java driver. For more information, see http://cdn.cdata.com/help/EJF/jdbc/.

Note:

If you need to use ODBC on Linux, use the ODBC-JDBC bridge (ODBC connectivity from the generic JDBC driver).

DSN vs. Connection-String (DSN-Less)

A connection to the provider is configured by a connection-string. Microsoft windows allows you to store the connection string properties in its registry for further use. It supplies an ODBC configuration wizard and requests an identifying Data Source Name (DSN).

When you add an ODBC table in Sisense, the connection configuration dialog will provide you with two options:

  • DSN – choosing a data source name.
  • Connection String (DSN-less) – entering the actual connection string

Enabling Generic ODBC Driver Connections

From Sisense 8.2.5 for Windows, by default, the ability to connect to Generic ODBC drivers is turned off. This is because Sisense highly recommends using JDBC connectors, instead. However, if you need to use ODBC drivers, you must enable the feature in your instance of Sisense.

  1. On your computer, navigate to: C:\Program Files\Sisense\DataConnectors\DotNetContainer\Connectors\GenericODBC\

  2. Edit Sisense.Connectors.OdbcConnector.dll.config with a text editor (run as Administrator).

    8-5edit-odbc-config-filethumb0300.png

  3. In the file, find key=”ShowInWebECM” and change the value to “true”.

    8-5change-gen-odbc-flagthumb0300.png

  4. Save and close the file.

  5. Open the Windows Task Manager and Restart the CLRConnetorsContainer service.

    8-5restart-CLRConnetorsContainerthumb0300.png

Adding Tables to Sisense

Once you have enabled ODBC Driver connections, you can add tables to Sisense.

  1. Click Add Data in the top menu of Sisense.

  2. Under the Database servers category, select Generic ODBC Driver.

    8-5generic-odbc-connectionthumb0300.png

  3. From the ODBC Connectivity Properties dialog select DSN or Connection String (DSN-less).

    DSN: Choose one of the existing DSNs from the drop-down list (existing DSNs are retrieved from the Windows server DSN settings)

    Connection String:
    1. Enter the connection string. For known connection strings, click the Help link to navigate to Connection Strings (external site from Sisense).
    2. Click Test Connection to test the connection.
    3. Click OK to move to the final dialog.
    4. From the tables selection dialog, select tables that you want to add.
    5. Click Add to complete the wizard.

    8-5generic-odbc-settingsthumb0300.png

Note:

You may need to update the executed table query.

Setting the Table Query (Troubleshooting)

ODBC and OLE DB are generic drivers. Therefore, the SQL syntax being executed against the actual data source may vary from one provider to another.

Sisense sets by default the standard SQL for the ODBC/OLE DB tables which covers most of today’s known data providers. When non-standard SQL must be supplied, the table addition dialog provides a quick preview of the current SQL query and an Edit button that opens the Query Properties dialog.

In Query Properties, set the following options:

  • Auto Query Structure: Select the proper SQL syntax delimiter.
  • Manual Query Input: Enter your query.

Customizing Your ODBC Connection

Though there are hundreds of data sources available, the generic ODBC driver can help you connect to almost all of them. However, if the default settings do not fit your specific use-case, Sisense enables you to customize your ODBC connection to give you the functionality you need.

When you add an ODBC connection to your Sisense configuration, Sisense saves the details of your connection in an odbcConfig.json file. This configuration file, written in JSON syntax, is located in the directory: …\Program Files\Sisense\DataConnectors\DotNetContainer\Connectors\GenericODBC. You can edit this file to add functionality such as support for accumulative builds, increase query timeouts, or modify your query patterns.

The odbcConfig.json file contains the following objects that you can edit to modify your connectors behavior:

NameTypeMandatoryDescription
ProviderStringYesThe name of your data source. This name must be unique.
DriverNamesStringYesAn array of ODBC driver names. If you do not know a driver name, you can check "Connectors.log".
IsAccumulativeSupportedBooleanNoIndicates whether accumulative build is supported.Default value: false.
IsRelationsSupportedBooleanNoEnable/disables relations functionality in the ElastiCube Manager.Default value: false.
QueryTimeoutIntegerNoQuery timeout value. You can increase this value if your datasource takes longer to establish a connection.Default value: 0.
QuerySettingsQueryConfig*NoDatasource specific query settings (see the QueryConfig Object table below).Default value: default query config values.
ExtensionStringNoA name of the assembly with the appropriate extension.Default value: none.

QueryConfig Object

NameTypeMandatoryDescription
ColumnNamePatternStringNoA pattern which represents the column name format (should include appropriate separators).To create a pattern, use the following keywords:.@schema: Schema name (when schema is empty, the table name is used, instead).@table: Table name.@column: Column name..Example: `@schema`.`@column`.Default value: [@column]
TableNamePatternStringNoA pattern which represents the table name format (should include appropriate separators). To create a pattern, use the following keywords:@schema: Schema name (when schema is empty, the table name will be used, instead).@table: Table name.Example: "@schema"."@table"Default value: [@schema].[@table] or [@table] in the case when the schema name is missing.
PreviewSqlPatternStringNoA pattern which represents preview SQL format (should include appropriate SQL operators). To create a pattern, use the following keywords:@rowcount: The number of rows to show.@sql: Inner select.Example: SELECT * FROM (@sql) LIMIT @rowcountDefault value: SELECT TOP @rowcount x.* FROM (@sql) x
DateTimeFormatStringNoThe format used to convert a DateTime value to a string for an accumulative workflow.
See more information about standard formats, here.
See more info about defining a custom format, here.
Default value: sortable format specifier.

Accumulative Build Support

The Sisense ODBC connector supports accumulative builds for certain data sources. Some of these are supported by default, while you must activate others through the ODBC configuration file. The list of supported data sources is below. If you want to activate accumulative build support for a data source, open the file odbcConfig.json file, located in here: C:\Program Files\Sisense\DataConnectors\DotNetContainer\Connectors\GenericODBC\

The configuration file includes JSON objects that represent each data source. Within each data source object is a boolean called IsAccumulativeSupported . When this value is true, the option to perform an accumulated build is available. The "false" value removes this option. Below is an example object for MSSQL.

{
"Provider": "Mssql",
"DriverNames": [
"SQLSRV32.DLL",
"SQLNCLI11.DLL"
],
"IsAccumulativeSupported": true
},

After changing the value of IsAccumulativeSupported , save the file to update the supported build options in Sisense.


Was this article helpful?