Configuring Databases by Using Custom JDBC Driver

You can configure any database such as Teradata and Sybase by using a custom JDBC driver.

Points to note

  • If you are using the Data Merger or Data Requester activities, you can insert maximum 16 records in the Teradata database concurrently.
  • To avoid issues that can occur after you click the Validate schema button in the Shared resource dialog multiple times, add the LOB_SUPPORT=OFF attribute to the JDBC URL for the Teradata database.
    Procedure
    Note: Follow the same steps to configure a database by using JDBC custom driver on TIBCO Business Studio (Container Edition).
  1. In TIBCO Business Studio, go to Window > Preferences.
  2. In the left pane, under BusinessWorks > Palettes > JDBC, set the directory preference as follows: TIBCO_HOME/bw/version_number/config/design/thirdparty.
  3. Select the option Allow use of custom driver, click Apply, and then click OK.
  4. Copy the JDBC server JAR files such as terajdbc4.jar to the directory preference location selected in the earlier step.
  5. If you have already configured the JDBC driver, skip this step. Otherwise, restart TIBCO Business Studio.
  6. Create a JDBC connection. Fill in the driver details and user credentials. The following example shows the details as required for Teradata database:
    Database Driver: custom.jdbc.driver
    Database URL: jdbc:teradata://<host>/database=<db_name>, TMODE=<mode>
    DataBase Driver: com.teradata.jdbc.TeraDriver
    DataBase Name: <db_name>
    JAR File: terajdbc4.jar
    Note: Ensure that there is no whitespace in the database URL.
    JDBC Connection for Teradata

  7. Click Test Connection.
    The Custom Driver Runtime Support pop-up window is displayed. Click OK.
    Custom Driver Runtime Support

     

    A new plug-in project is created.
  8. In the New Plug-in Project window, click Next.
  9. In the next New Plug-in Project window, click Next.
  10. Click Finish. A custom project is created in the workspace with compilation errors.
  11. Open the Java file present in the src folder of the new project and make the following changes to the highlighted code as can be seen in the following images.
    In the createDataSource method, comment the statement setProperties(theInstance, props).
    In the createConnectionPoolDataSource method, change the method arguments in the setProperties(theInstance, props) to resolve the syntax error.
    In the setProperties method, comment the statement theInstance.setPortNumber(Integer.valueOf(port)).
    Java File to be Edited

     

     

    If you have a different DataSource class name, make changes in the code accordingly. You must set an additional property of the DataSource name in the setProperties method. The compilation errors should now be resolved.
    Note: The IP address of the Data Source name must match the IP address in the Database URL provided when creating the JDBC connection.
  12. Go to the JDBC connection and test the connection again. The connection is successfully established.
    JDBC Connection for Teradata

  13. To verify that the JDBC connection is done, go to Run > Debug Configurations.
  14. In the left pane, click BusinessWorks Applications > BWApplication.
  15. In the right pane, click the Bundles tab and ensure that the name of new project created earlier is displayed and the checkbox is selected.
    Debug Configuration

    For more information, see "Using Custom Drivers" topic in TIBCO ActiveMatrix BusinessWorks™ Bindings and Palettes Reference Guide.