How to use a custom driver with BW 6.x ?

How to use a custom driver with BW 6.x ?

book

Article ID: KB0070217

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks 6.x

Description

Examples shown in this solution are taken from creating a Custom Driver for DB2 on AS400. This procedure will be the same for any other custom driver.

Note: 
Custom drivers must be compliant with the JDBC 4.0 API Specification. BusinessWorks 6.x does not support JDBC driver version 3.x or lower. In this particular scenario jt400.jar must be JDBC 4.0 or higher.

  • To verify the version of the driver you’re using, follow the steps provide by IBM in below page: "https://www.ibm.com/support/pages/determining-version-ibm-toolbox-java"

User-added image
 

  • If correctly followed you should see the above image (as per your driver)  
 
Design Time

 

Enabling Custom Drivers 

1. In Business Studio, under Preferences ? BusinessWorks ? Palettes ? JDBC, select Allow use of Custom driver option.  

(Refer to attachment Screen1.png)

2. Place the jt400.jar under BW_HOME/config/design/thirdparty directory as referred under the Preferences option shown in Screen1.

3. Restart BusinessStudio.  

 

 

Configuring JDBC Shared Resource  

 

1. Configure the JDBC Shared Resource with the necessary parameters as shown below. 

 

  • The JAR extension required for JAR File name field.  
  • Database driver is custom.jdbc.driver from the dropdown options.  
  • Database specific details like URL, Driver Name and the DB Name.  

(Refer to attachment Screen2.png)

 

2. Click Test Connection. This will prompt to create the runtime bundle as shown below. 

 

 

  • The below wizard is populated only if the Test Connection has established a successful connection with the DB configured in the JDBC shared resource.  

(Refer to attachment Screen3.png)

 

3. Click OK on the Custom Driver Runtime Support and a new Plug­in Project wizard is launched. 

 

  • Under Plug­In Project pane, enter the project name and other fields can be default values.  
  • Under Content pane, accept the default values. 
  • Under Custom Driver Properties pane, provide Datasource and Pooled Datasource Class .
  • Click Finish.

(Refer to attachments Screen4.png, Screen5.png and Screen6.png)

 

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

*************************************************************************/ 

Edit the methods and properties provided in the template file or add your own. Comment out or change methods that are not relevant to the driver being used.

 

 

Runtime 


 

Create runtime bundle  

 

If the runtime bundle was not created as explained in step 3 above, it can be created using the New ? Plug­in Project Wizard. Navigate steps 3 to 4 (for field values) and create the runtime bundle. (On the Templates pane, select Tibco Custom Driver Template) 

 

(Refer to attachment Screen7.png)

 

Run/Debug the application 

 

1. Using Studio 

Ensure the runtime bundle is selected along with the BW application under Run/Debug configurations.  

(Refer to attachment Screen2.png)

 

2. Outside Studio? [using bwadmin or TEA] 

 

Export runtime bundle as JAR: This is an additional step needed to export the runtime bundle as a JAR.  

 

i) Right click on the bundle and Export ? Plug­in Development ? Deployable plug­ins and fragments.  

(Refer to attachment Screen9.png)

 

ii) Select the runtime bundle, provide a target directory and click Finish.

(Refer to attachment Screen10.png)

 

iii) This creates a JAR inside the plugins folder.

 

iv) Move the JAR file under BW_HOME/system/shared. The JAR has to be at the root level of shared folder.

 

[NOTE: Screen shots are included within attachment Custom_Driver_ScreenShots.rar attached to article]

Issue/Introduction

How to use a custom driver with BW 6.x ?

Additional Information

1. Verifying the version of JDBC driver:
https://www.ibm.com/support/pages/determining-version-ibm-toolbox-java

Attachments

How to use a custom driver with BW 6.x ? get_app