Introducing the all-new TIBCO Community site!

For current users, please click "Sign In" to reset your password and access the enhanced features. If you're a first-time visitor, we extend a warm welcome—click "Sign Up" to become a part of the TIBCO Community!

If you're seeking alternative community sites, explore ibi, Jaspersoft, and Spotfire.

Jump to content
  • Enabling TIBCO® Data Virtualization JDBC Connections in TIBCO BusinessWorks?


    Deepesh Tiwari

    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.

    Getting Started

    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.

    Design Time Configuration

    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):

    screen_shot_2018-01-22_at_3_30.04_pm_0.png.9777a6e984038ac7e84ab0e17d80b7ec.png

    Copy/Paste Text: 

    jdbc:compositesw:dbapi@<hostname>:<port>?domain=<domain>&dataSource=<database>

    cs.jdbc.driver.CompositeDriver

    csjdbc.jar

    ** 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.

    Runtime Configuration

    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. 

    screen_shot_2018-01-22_at_3_40.43_pm.png.5e3e8b545e02e102b440b6053e8a092e.png

    Configure the Plugin Wizard per the following screen shots:

    Set the Name for the Plugin

    screen_shot_2018-01-22_at_3_41.19_pm.png.1de4c6ce082b9ad9297bec06737f801f.png

    Accept the Defaults

    screen_shot_2018-01-22_at_3_54.19_pm.png.18f312b86e147eb0e55d697ac916c983.png

    Update the Datasource Class and Pooled Datasource Class fields (copy/paste text below)

    screen_shot_2018-01-22_at_3_43.26_pm_0.png.2deb9920fc49575bdf12770b85b2866b.png

    Copy/Paste Text:

    cs.jdbc.driver.CompositeDataSource

    cs.jdbc.driver.CompositeConnectionPoolDataSource

    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.

    screen_shot_2018-01-22_at_3_57.46_pm.png.d6985662d61cfebb83a46c40e535e153.png

    First you must import the package containing the datasource class files:

    screen_shot_2018-01-22_at_3_59.10_pm.png.2525ce9953b61aa0f039e9feec5f8aca.png

    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
    throws SQLException
    • Comment out the ds.setServerNameds.setPortNumber and ds.setDatabaseName lines and add ds.setUrl(url)
    • screen_shot_2018-01-22_at_4_04.20_pm.png.7f4d9c3abce52f05bc37fbfc0469f1c7.png
    • Duplicate the entire setProperties method by copying and pasting it below itself and change the first parameter to CompositeConnectionPoolDataSource

    screen_shot_2018-01-22_at_4_07.16_pm.thumb.png.5d28c22e90bfd7e887a784ff95449cab.png

    ** 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

    screen_shot_2018-01-22_at_4_09.24_pm.png.e32f85713eff740fbab2e6714150c49d.png

    screen_shot_2018-01-22_at_4_09.40_pm.png.b9614f8302dfb6f47836374e2427ae27.png

    Ensure the Plugin Project is selected and enter the destination as <BW_HOME>/system/shared and click Finish

    screen_shot_2018-01-22_at_4_10.30_pm.png.68b3d4534aa3b3d612fdafc25c9bf9bb.png

    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.

    screen_shot_2018-01-22_at_4_11.20_pm.png.5c45bb2ac106e0de17e76bbc19b53f76.png

    ** This step MUST be done. Move the JAR file and DELETE the empty plugins directory or Studio will not function properly.

    Test and Run

    Once Studio has restarted you can Open the JDBC Connection Resource and Click the Test Connection button again

    screen_shot_2018-01-22_at_3_31.22_pm.png.b1422a9e8d74df043f906e010ff7b1ee.png

    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

    screen_shot_2018-01-22_at_4_19.07_pm.png.7e9bf3c00216052a2cd9c2b04e9de942.png

    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

    tibco_dv_jdbc.zip


    User Feedback

    Recommended Comments

    There are no comments to display.


×
×
  • Create New...