JDBC Connection

JDBC Connection resource describes a JDBC connection. JDBC connections are used when specifying activities from the JDBC palette.

General

The General section has the following fields.

Field Description
Package The name of the package in which you want to create a shared resource.
Name The name of the shared resource.
Description A short description of the shared resource

JDBC Connection

This section has the following fields.

Field Literal Value/Module Property Description
Connection Type None Specifies the kind of JDBC connection you want to create.
Maximum Connections Yes The maximum number of database connections to allocate. The default maximum is 10. The minimum value that can be specified is 1.
Login Credentials Yes The user name used to connect to the database.

The password used to connect to the database.

JDBC Driver

This section has the following fields.

Field Literal Value/Module Property Description
Database Driver Yes The name of the JDBC driver class. If you select a supported driver from a list of supported drivers, the Database URL field is populated with a template for the URL of the driver.

The following drivers are packaged:

  • PostgreSQL
  • Microsoft SQL Server
In addition, the JDBC palette also supports the MySQL, Oracle, and DB2, and MariaDB database.
Note: The TIBCO Business Studio™ for BusinessWorks™ product can connect with MariaDB ® or MySQL through use of MariaDB® Connector/J, which is subject to free and open source software license terms and available at https://mariadb.com/downloads/mariadb-tx/connector. MariaDB Connector/J is not part of the product and therefore not within the scope of your license for the TIBCO Business Studio for BusinessWorks product. Accordingly, MariaDB Connector /J is not covered by the terms of your agreement with TIBCO, including any terms concerning support, maintenance, or warranties. Download and use of MariaDB Connector/J is solely at your own discretion and subject to the free and open source license terms applicable to MariaDB Connector/J.
When editing this field, you can also specify for the JDBC Palette to use a custom JDBC driver. For instructions on how to do this, see Using Custom Drivers.
Note: Custom drivers must be compliant with the JDBC 4.0 API Specification.
Database URL Yes The URL to use to connect to the database. A template of the URL is supplied for the selected JDBC driver. You must supply the portions of the URL that are in angle brackets (<>).
Login Timeout (secs) Yes The length of time (in seconds) to wait for a successful database connection.

Only JDBC drivers that support connection timeouts can use this field. If the JDBC driver does not support connection timeouts, the value of this field is ignored. Most JDBC drivers support connection timeouts.

Connection Idle Timeout Yes

This option monitors the given time. When the time lapses, it cleanly closes the connection awaiting inside the pool of connections.

You can provide time in any of the following units:
  • Seconds
  • Minutes
  • Hours

When you choose Minutes option and then select the Hours option, the value is rounded up to the nearest whole number. That is, 300 seconds are converted to 5 minutes or 1 hour.

When you choose Hours and then select Minutes option, the rounding takes place at the most convenient whole number. That is, 1 hour becomes 60 minutes or 3600 seconds.

The default value is 300 seconds.

Note: If you enter a value less than or equals to Zero (0), the monitoring does not take place. The pool does not close any physical connection.

Test Connection

Click the Test Connection button to test whether the specified configuration fields result in a valid connection to a database.

Installing Supported Drivers for Run Time

If you want to use other databases, other than PostgreSQL or Microsoft SQL Server, you must add them separately. This is a one-time process for every installation of TIBCO BusinessWorks™ Container Edition

To add the drivers at run time for Oracle, MySQL, DB2, or MariaDB, run the bwinstall command from TIBCO_HOME/bwce/version/bin. Ensure that you run bwinstall with no arguments to access the help and instructions to add the driver to the run time.

Supported Drivers

The following database drivers are supported:
  • com.mysql.jdbc.Driver
  • org.postgresql.Driver
  • oracle.jdbc.OracleDriver
  • com.microsoft.sqlserver.jdbc.SQLServerDriver
  • com.ibm.db2.jcc.DB2Driver
  • org.mariadb.jdbc.Driver
    Note: To connect to MySQL Server you can select the MariaDB native driver (org.mariadb.jdbc.Driver) from the Database Driver drop down menu.
The following Data Direct Drivers are supported:
  • tibcosoftwareinc.jdbc.postgresql.PostgreSQLDriver
  • tibcosoftwareinc.jdbc.mysql.MySQLDriver
  • tibcosoftwareinc.jdbc.sqlserver.SQLServerDriver
  • tibcosoftwareinc.jdbc.db2.DB2Driver
  • tibcosoftwareinc.jdbc.oracle.OracleDriver

Enabling Custom Drivers

In TIBCO Business Studio for BusinessWorks, you can enable the JDBC palette to use custom drivers. Before you do this, ensure that you place the drivers in TIBCO_HOME/bwce/version/config/design/thirdparty.

  1. Click Click Here to Set Preferences. Optionally, go to Windows > Preferences > BusinessWorks > Palettes > JDBC.
  2. Select the Allow use of custom driver check box and click Apply.

  3. Click OK and restart TIBCO Business Studio for BusinessWorks for this configuration to take effect.

Configuring Use for a Custom Driver

Follow these steps to configure the JDBC Connection Shared Resourceto use a custom driver:

  1. Open the JDBC Connection Shared Resource from the Project Explorer.
  2. Click in the Database Driver field, and select the custom.jdbc.driver option from the drop-down menu.
  3. Edit the following fields that display under the Login Timeout (sec) field:
    • Database Driver: Type the name of the driver class to use.
    • Database Name: Type the name of the database to connect to. If the database name is the name of a schema, type the schema to connect to.
    • Jar File: Type the name of the Jar archive file stored at TIBCO_HOME/bwce/version/config/design/. This file to create the driver. If you are adding multiple Jar files, separate the file names with commas.
      Note: To ensure that TIBCO Business Studio for BusinessWorks creates a driver bundle for the application at run time, confirm that the Jar archive file is stored under the third party folder at .
  4. Click Test Connection. If you have entered the correct database connection details, and have already created a plugin project to support the custom driver, TIBCO Business Studio for BusinessWorks confirms that you have successfully connected to the database.
    Note: If you are unable to connect to the database you specified, check the configurations you made to the JDBC Connection Shared Resource. The database connection field can also fail if you have not created a plug-in project to support the custom driver at run time. In this case, TIBCO Business Studio for BusinessWorks displays a warning message indicating that it does not recognize the custom driver you selected. Click OK and complete step 5.
  5. Follow these steps:
    1. In the Create New Plug-in Project wizard that displays, enter a name in the Project name field, accept the default selections, and click Next.
    2. In the Content pane, accept the default values, and click Next.
    3. In the Custom Driver Properties pane, edit the following fields:
      Tip: Refer to your JDBC driver documentation for additional details.
      • Datasource Class: Type the name of the class that TIBCO BusinessWorks Container Edition should use to establish a connection data source between the JDBC Connection Shared Resource and the database.
      • Pooled Datasource Class: Type the name of the class that TIBCO BusinessWorks Container Edition should use to create a pooled connection data source data source between the JDBC Connection Shared Resource and the database.
    4. Click Finish, and the newly created plug-in project displays on the Project Explorer pane. Click the custom plug-in project to expand it.
    5. Click the src folder to display the java file, and double-click the java file to edit it. Locate the following instructions in the Java file, and follow them to import packages that contain the datasource and pooldatacourse classes:
       /****************************** TODO************************************ 
      * Import the packages from jar that contain the data source and drivers  * 
      * by hovering over the data source class name with your mouse and        *
      * select the import option                                               *
      *************************************************************************/ 
    6. Edit the methods and properties provided in the template file, or add your own.
      Note: Methods with the @Override annotation can be modified. Whether you edit @Override methods, do not remove them from the template file.

Setting up Custom Drivers for Run Time

Follow these steps to set up custom drivers for run time:
  1. Export the custom driver JAR file by right-clicking on the Plugin-Project from the Project Pane and clicking Export > Plug-in Development > Deployable plug-ins and fragments.
  2. In the Export wizard, complete the following steps:
    1. Select a plug-in project.
    2. On the Destination tab, and specify <BWCE_HOME>/system/shared as the target directory to export the runtime bundle.
  3. Click Finish to export the plug-in project as a JAR file. The JAR file is exported to the plugins folder at <BWCE_HOME>/system/shared/plugins.

    For Docker, see Extending the Base Docker Image in the TIBCO BusinessWorks™ Container Edition Application Development guide.

    For Cloud Foundry, see The TIBCO BusinessWorks™ Container Edition Buildpack in the TIBCO BusinessWorks™ Container Edition Application Development guide.

    Note: The plugins folder is automatically generated after you export the JAR file, but you can delete this folder after moving the JAR file to the shared folder at <BWCE_HOME>/system/shared.

Uninstalling Drivers for Run Time

To uninstall the drivers at run time for Oracle, MySQL, DB2, and MariaDB, run the bwuninstall command from TIBCO_HOME/bwce/version/bin/thirdparty. Ensure that you run bwuninstall with no arguments to access the help and instructions to uninstall the driver at run time.