App Connect

 View Only
Expand all | Collapse all

ConnectingToCloudantDBwithDynamicDatabaseName

  • 1.  ConnectingToCloudantDBwithDynamicDatabaseName

    Posted Mon February 21, 2022 04:42 AM
    Hello Developers,
    I have a requirement to create and connect to Cloudnat DB using a dynamic database name(eg:cloudant_today'sdate).  I am planning to implement this using loopback request node. I have a few queries with the solution as I have never interacted with the Cloudant DB.

    Can we create the db in cloudant using IIB flows.?
    Can i setup the security credentials of DB from message flows i.e. running of "mqsisetdbparms" from message flow, can we do that?.
    Is there any way that we can create free cloudant db instances, i have tried but asking for creditcard information.



    ------------------------------
    kota lella
    ------------------------------


  • 2.  RE: ConnectingToCloudantDBwithDynamicDatabaseName

    Posted Thu February 24, 2022 02:41 PM
    Hi Kota,

    No, the LoopBackRequest node is not an open syntax node.  It requires certain items be provided.  It allows you to add, subtract, update, and delete records in a database.  It does not include options for managing the database nor using dynamic database names.

    You may be able to accomplish this with JDBC.  To do this, you'd need to manage the JDBC connection yourself rather than using the IIB/ACE provided structure.  The reason is that both ODBC and JDBC like LoopBack have the database definitions created before the flow starts in the odbc.ini, JDBC Providers configurable service/policy, and datasources.json, respectively.  IIB/ACE does a lookup on a short name in the node to find the database definitions.  Thus, to get dynamic names, you'd have to control all aspects of the connection.

    The database name should also not be something that is dynamic.  Dynamic tables, sure, but not the database itself.  This is a very unusual requirement.

    Creating a database is as possible as dynamic naming.  The problem here again is IIB/ACE connects directly to the database.  It does not connect to the database server where administration commands can be run.  To accomplish this, from a Java compute node, you would need to SSH or use a Java library that allows you to connect to the database server and then run admin commands.

    For mqsisetdbparms, technically yes, but realistically, no.  From a JCN, you can use Java's Runtime class to execute command line commands (may be useful for above).  From this you could call mqsisetdbparms.  While this is perfectly fine, credentials are not available until the integration node is restarted.  If you can perform a restart every time the flow creates the credentials, then this will work, but for a dynamic flow, this is not realistic.

    For cloudant, you can create a trial here.  You will likely only be able to create one.  An unlimited number would be an abuse and likely stopped.

    ------------------------------
    MATTHEW SEGALL
    ------------------------------