Connecting to TDV as Data Source from SnappyData¶
Overview¶
TIBCO Data Virtualization (TDV) is an enterprise data virtualization solution that orchestrates access to multiple and varied data sources and delivers the datasets and IT-curated data services foundation for nearly any solution. SnappyData can connect to TDV as a data source to import, process, and store data.
Version and Compatibility¶
SnappyData edition 1.3.1 is tested and works with TIBCO Data Virtualization 8.2.0 - 8.5.x versions.
Connecting to TDV from SnappyData¶
- Publish the view from TDV Studio that needs to be accessed as a data source from SnappyData.
- Note the name of the Data Source that is associated with the view that should be published. For more information, refer to the TDV documentation.
-
Log on to the machine where SnappyData is installed and go to the SnappyData installation directory.
-
Make sure SnappyData is running by executing the following command:
- Launch the SnappyData SQL shell:
- Connect to the running SnappyData cluster:
snappy>connect client '<host-name>:<locator port>';
For example: snappy>connect client '<localhost>:<1527>';
- Deploy the JDBC jar of the TDV module:
snappy>deploy jar <jar alias> '<SnappyData installation directory>/connectors/csjdbc8.jar';
For example:
snappy>deploy jar dv-jar '/snappydata/snappy-connectors/tdv-connector/lib/csjdbc8.jar';
!!!Note
The above jar may not be available in the SnappyData Community edition.
In that case find and copy it from your TDV installation.
!!!Note
You should execute this command only once when you connect to the TDV cluster for the first time.
-
Create an external table with JDBC options:
CREATE external TABLE <table-name> USING jdbc OPTIONS (dbtable '<View name in TDV studio>', driver 'cs.jdbc.driver.CompositeDriver', user '<TDV user>', password '<TDV password>', url 'jdbc:compositesw:dbapi@<TDV hostname>:<Port>?domain=composite&dataSource=<TDV Data source>'); For example: CREATE external TABLE ext_tdv USING jdbc OPTIONS (dbtable 'CompositeView', driver 'cs.jdbc.driver.CompositeDriver', user 'admin', password '<TDV password>', url 'jdbc:compositesw:dbapi@tdv-host:9401?domain=composite&dataSource=DV-DS');
-
Run the required SQL queries on the created external table.
If you install both TDV Studio and SnappyData on different machines, ensure the machine on which TDV Studio is hosted, is accessible from the machine on which SnappyData is installed. If TDV is installed on a Windows machine, ensure to create a rule in the Firewall settings. This rule should allow the inbound traffic for all the ports from the machine on which SnappyData is installed. Use the following steps to do this on Windows Server 2012 edition:
- Go to Windows Firewall with Advanced Security -> New rule.
-
Provide the following details:
Item Option to Select Type of rule Port Does this rule apply to TCP or UDP TCP Does this rule apply to all local ports or specific local ports Select All local ports. What action should be taken…. Allow the connection When does this rule apply? Select all the options -
Enter the appropriate name for the rule and click on the Finish button.