Selcuk

Introduction

Sometimes we can store data as a JSON format in our DB2 database and we need to create a new table according to this JSON.

You can see an example for JSON to TABLE conversion DB2 below.

Implementation

First of all we need to keep our data in BSON (Binary JSON) format in DB2 database. If it is not BSON then first we need to convert it to JSON to BSON.

SYSTOOLS.JSON2BSON is converting JSON string to BSON object.

JSON_VAL is converting BSON object to TABLE.

First parameter is our BSON object (myData).

Second parameter is JSON parameter name.

Last parameter is the type of the value (s:40).

--

--

While we are dealing with business objects in BAW javascript, we may need to do some comparation between values.

If we are dealing with complex business object and try to compare it in deeper levels it may get a Nullpointer exeption.

Lets say that we have a business object like below.

And we would like to check if address.number is X or not.

--

--

First we need to create a db2 connection like below

Then we need to add SSL setting under“Driver properties” tab.

Properties KeyValue Pair:

sslTrustStorePassword => Password of your trust store
sslTrustStoreLocation => Location of your trust store in your local harddrive
sslConnection => true

--

--

Selcuk

Selcuk

IBM BPM/BAW Developer #Java #IBMCloud #IBMBPM #IBMBAW #BPM