Often several of my students have asked me to show a scenario on how to retrieve database records using java compute node.
Some others have asked, how to build the complete message tree from scratch in JCN.
And some others have asked how to build a COBOL result records in JCN.
I have put all three of them together to demo a simple scenario.
Pre-requisites :-
- In my classes I have shown you, how to setup DB2 sample database. We will use the same EMPLOYEE table from that database.
- In my database classes I have shown you how to create configurable services and ODBC/JDBC DSNs. We will use the same JDBC type 4 drivers with configurable service defined.
- You should have the EMPLOYEE.cpy COBOL and inputmessage XML file which I have shared in the class to successfully run this example.
Steps to implement this lab :-
- Create an Application and create a model using supplied COBOL file. You would get EMPLOYEE.xsd generated by the DFDL Message Model editor
- The generated EMPLOYEE.xsd would look like :-
- Create a simple message flow :- MQInput Node -> Java Compute Node -> MQOutput Node
- Set MQInput properties
- Basic :- Give the input queue name
- Input Message Parsing :- XMLNSC domain
- Set MQOutput properties
- Basic :- Give the output queue name
- Set Java Compute (choose to create a message tree without copying input tree)
- Import the following as shown in the figure :-
- Use the following two methods :- Copy Message Headers & Evaluate method
- Deploy the flow for a quick test.
- Put the test input message with the employee number something like <EmployeeID>000010</EmployeeID>
- See the output in COBOL format like :-
No comments :
Post a Comment