In order to write the Java application, the IMS universal JDBC drivers, Java dependent region adapter and database resource adapter file are present on your development system.
Use standard JDBC programming to develop the program
Let’s say the database in question is an insurance database and the use case is to find information on all the policies for a certain customer
This translates to an SQL query “SELECT FIRSTNAME, LASTNAME, CUST_STREET, CUST_CITY, CUST_STATE, CUST_ZIPCODE, DATEOFBIRTH FROM INSURPCB.CUSTOMER WHERE CUSTOMERNUMBER = ?”
Let’s say this insurance database has three types of policies for every customer, life, home and auto.
then you would use this for auto policy for example
PreparedStatement autoPolicyStatement = conn.prepareStatement(“SELECT POLICYNUMBER, CAR_MAKE, CAR_MODEL, CAR_MANUFACTUREDATE, CAR_REGNUMBER, CAR_DRIVERNAME FROM INSURPCB.POLICY WHERE CUSTOMER_CUSTNO = ? and POLICYTYPE=’A'”);
And for home insurance policy
PreparedStatement housePolicyStatement = conn.prepareStatement(“SELECT POLICYNUMBER, HOMEPROPERTYTYPE, HOMEBEDROOMS, HOMEHOUSEVALUE, HOME_STREET, HOME_ZIPCODE FROM INSURPCB.POLICY WHERE CUSTOMER_CUSTNO = ? and POLICYTYPE=’H'”);
Complete source code is provided in the code samples section.
Watch this video to learn how to develop an application that sends input message to IMS TM, queries IMS DB and returns output message.
IMS Explorer for Development is a great tool to visualize IMS database. In the Set up section, you have downloaded and installed E4D. You can use it to connect to a live DB to explore, visualize and query.
When you are using the Distributed Access method, where your program is running outside of z, you have to have the infrastructure enabled. If you are using the Local Access method, you may still want to ask a Systems Programmer or DBA to set up the infrastructure so that you can visualize and Query. Watch these videos to learn how to use E4D to explore
and model SQL queries
Once you have the application ready, get ready to deploy. If using the local access method, application is deployed on z/os using standard methods.