Table of Contents
Enabling the TIBCO® Data Virtualization JDBC driver in TIBCO BusinessWorks? is a fairly straight forward process but does involve some tweaking to make a successful runtime connection.
To begin you should review the steps to enable Custom Drivers in the BusinessWorks or BusinessWorks Container Edition documentation:
As a pre-requisite you must obtain the csjdbc.jar file which contains the TIBCO Data Virtualization JDBC Driver. Copy this jar file to the following directory: <BW_HOME>/config/design/thirdparty (same path for BWCE_HOME).
Follow the steps in the above documentation to allow the use of custom drivers and restart Studio.
Once this is complete, open a BusinessWorks Application Module and create a new JDBC Connection Shared Resource. Enter the username and password for the TIBCO Data Virtualization instance and then configure the JDBC Driver as follows (copy/paste text below):
** Please note that for this configuration the DataBase Name field is NOT used but MUST be provided. Either put the database name from the Database URL or simply put something like ?foo?.
Click the Test Connection Button.
The first time the Test Connection button is clicked you will be prompted to configure the database driver for Runtime. You will find a completed Plugin JAR file attached to this article but you are encouraged to follow these steps to be familiar with the configuration and be able to debug issues should they arise.
Configure the Plugin Wizard per the following screen shots:
Set the Name for the Plugin
Accept the Defaults
Update the Datasource Class and Pooled Datasource Class fields (copy/paste text below)
Upon clicking Finish you will see the Plugin Project added to your Workspace. Expand the project and drill down into the src folder until you see the CustomDataSourceFactory.java source file. Double click it.
First you must import the package containing the datasource class files:
Next you will need to make a few modifications to the code.
Locate the setProperties method and do the following:
- add throws SQLException to the method declaration
- Comment out the ds.setServerName, ds.setPortNumber and ds.setDatabaseName lines and add ds.setUrl(url)
- Duplicate the entire setProperties method by copying and pasting it below itself and change the first parameter to CompositeConnectionPoolDataSource
** You should now have 2 setProperties methods, one taking a CompositeDataSource and the other taking a CompositeConnectionPoolDataSource. Feel free to refactor the duplicate code but it is not necessary.
Now you must export this project as a Plugin Fragment
Ensure the Plugin Project is selected and enter the destination as <BW_HOME>/system/shared and click Finish
You will find a directory called plugins created in this location. Copy the JAR file to the <BW_HOME>/system/shared directory (up one level) and delete the plugins directory. Restart Studio.
** This step MUST be done. Move the JAR file and DELETE the empty plugins directory or Studio will not function properly.
Once Studio has restarted you can Open the JDBC Connection Resource and Click the Test Connection button again
Also be sure to add the Plugin bundle to any Runtime Configurations you have defined. You simply need to check the box next to the bundle
You should now be able to develop and run processes connecting to TIBCO DV. Be sure to copy this JAR file to your runtime systems, placing it in the same location on the server(s) as above.
Enjoy your Virtual Data World!!
TIBCO Solutions Corner Home Page: https://community.tibco.com/s/article/tibco-solutions-corner