How to insert CLOB data in a database using the DB task in TIBCO IntegrationManager.

How to insert CLOB data in a database using the DB task in TIBCO IntegrationManager.

book

Article ID: KB0094671

calendar_today

Updated On:

Products Versions
TIBCO IntegrationManager -
Not Applicable -

Description

Description:
You cannot insert a CLOB directly into a database in TIBCO IntegrationManager using the DB Task. There is an workaround through which you can use a Java process to insert CLOB.

Issue/Introduction

How to insert CLOB data in a database using the DB task in TIBCO IntegrationManager.

Resolution

The workaround demonstrating how to insert CLOB into a database is provided in the attached sample project (Filename: InsertCLOB_DB.zip). To run the example, complete the following steps. First add the following custom property to your .cfg file: Config.Primary.Compatibility.JDBC.ConvertObjects: false

1).  Create the testclob table using the attached script.
2).  Open the dat file attached and Edit the File Channel location to point to a suitable file.
3).  Edit the Oracle Channel and put in your JDBC URL.
4).  Change the Username and Password in the Shared Parameters.
5).  Start the IM Engine. It will trigger itself by polling the file specified.
6).  Using DB Task, we will first created a row where we want to insert a Data and then using second DB Task to get the CLOB Column for update.  

The only catch in this is that you can not write a CLOB to a database using the same Property file as you would to read it. In order to write a CLOB you will need the property “Config.Primary.Compatibility.JDBC.ConvertObjects” to be set to “false” so that you can use JDBC methods to write CLOB into DB. To read you will need the property to be set to “true”. Else, you can just set the above property to "false" and use a JDBC method to read and write CLOB.

Note that the attached is an example. You have to modify it to meet your requirements and test it thoroughly before using it in the production.

Attachments

How to insert CLOB data in a database using the DB task in TIBCO IntegrationManager. get_app