To use DB2 in Node-RED, you need to create a sqldb service in Bluemix first. This meant going back to the catalog, skipping to the Data Management section, selecting the sqldb service, and adding it to my application (see picture below). Thereafter, my application needed to be restaged (restarted), so that it could pick up the properties of the sqldb service.
|Adding the sqldb/DB2 service in Bluemix|
Now it was time for my coding and SQL skills (or so :). I picked an http input node, a sqldb input node, and an http output node and wired them together:
|App wiring in Node-RED|
|My DB2 code in Node-RED|
|Current time from DB2 returned|
BTW: Writing up this blog entry took three times as long as putting the example together and have it up and running. Can you do the same...?