I'm using the IBM Integration Toolkit 9. I have created a Java Compute node and I would like to set up a JDBC connection pool to an Oracle database, and use it from within the Java Compute node. How would I set up that pool? Using one of the "node" types? Specifically where would I plugin the DB user and password. (for ex. In WebLogic when you set up a DB Connection pool you can add the credientials on the console.) I don't want to type it on the command line. I would want it to be at least bundled with the bar file so it can be deployed in different envrionments. Thanks!
1 Answers
The JDBC conenction pool details and passwords are viewed as an "Administration Time" setting and it is therefore not possible to set them on the JCN at deploy time. Instead you reference a configurable service in your JCN code. For example in the call:
getJDBCType4Connection("myDataSource", JDBC_TransactionType.MB_TRANSACTION_AUTO)
This tells the node that at run time it will obtain the details for the jdbc connection from a configurable service called "myDataSource".
You can use either MB Explorer or mqsichangeproperties to create the relevant configurable service and you can control the pool size using the maxConnectionPoolSize. Similarly on this configurable service there is a property called "securityIdentity". This corresponds to a username and password which is set in the broker pwd store using mqsisetdbparms.
For example if you set your securityIdentity to myJDBCUser the following mqsisetdbparms command sets the username and password:
mqsisetdbparms -n jdbc::myJDBCUser -u myUserName -p myPassword
This may seem initially like it is more complicated but this allows code to move between environments more easily by recognizing that the specific data base you are connecting to isn't important to the flow design and should therefore be decoupled from the design time artifacts.
In this way each broker can have a different configurable service definition defined for a JDBC database that corresponds to the equivalent database end point.
The use of the password store ensures that the login credentials are not stored in plaintext like the rest of the configuration data.

- 633
- 4
- 6