Can a connection to TIBCO Data Virtualization be established via Open Database Connectivity (ODBC), without configuring Data Source Name (DSN)?

Can a connection to TIBCO Data Virtualization be established via Open Database Connectivity (ODBC), without configuring Data Source Name (DSN)?

book

Article ID: KB0070899

calendar_today

Updated On:

Products Versions
TIBCO Data Virtualization All supported versions.

Description

Whenever an ODBC connection to TIBCO Data Virtualization needs to be established, we need to configure the Data Source Name (DSN) first. But is it also possible to make the ODBC connection to TDV without configuring the DSN?

Environment

All Supported Environments.

Resolution

Yes, the user can establish an ODBC connection to TIBCO Data Virtualization without defining a DSN by using a connection string. The connection string includes the details such as the server address, port, database name, and authentication information.
Connection String format: "Driver=<driver name>;Server=<fully qualified hostname>;Port=<port>;User=<username>;Password=<password>;domain=<domain name>;dataSource=<datasource name>"

The user can write a simple Python script to test this as below:
import sys,pyodbc

conn_string="""
Driver={TIBCO(R) Data Virtualization 8.8};Server=172.10.10.17;Port=9401;User=admin;Password=P@ssw0rd;Domain=
composite;dataSource=test_ds;validateRemote Hostname=false;connectTimeout=30000;enableFastExec=false"""

conn = pyodbc.connect(conn_string)
curr=conn.cursor()
curr.execute("""SELECT * FROM sample_table""")
rows = curr.fetchall()
for row in rows:
    print(row)

conn.commit()
curr.close()
conn.close()
This will successfully connect to TIBCO Data Virtualization via ODBC and display the contents of the published table (sample_table).
Note: The Driver name will be as per the ODBC driver version installed. Here the ODBC driver being used is 8.8 so the Driver Name is set as "TIBCO(R) Data Virtualization 8.8".
The ODBC driver name can be found in the Drivers tab of the ODBC Data Source Administrator for Windows and the 'odbcinst.ini' file's driver name section for Linux.

Issue/Introduction

This article will answer the above question and will explain the process as well.

Additional Information

Also refer TIBCO Data Virtualization Client Interfaces Guide for more information - https://docs.tibco.com/pub/tdv/8.7.0/doc/pdf/TIB_tdv_8.7.0_ClientInterfacesGuide.pdf (pg 101)