Problem solve Get help with specific problems with your technologies, process and projects.

Accessing a relational database on another platform

Our CICS/COBOL/VSAM application needs to access a relational database on another platform. What are the different methods to achieve this (JAVA in CICS, vendor tool, etc.)?
If this is DB2, then you don't have a problem. The DB2 instances residing in your MVS image can quite happily dispatch the request to other DB2s running elsewhere. In this case, you don't have anything special to do in the CICS application.

The next choice would be to contact the database vendor and ask if they have an RMI adapter that will run within CICS. If so, then you could issue a call in your application via a TRUE to the RMI adapter that would send off the request to where ever the database resided.

If neither of these approaches is available, then you could fall into the trap of using a database access designed for a batch job. This will be bad news on the performance front if running in the CICS environment so avoid this pitfall.

I think I'd be very inclined to go down the Java route, using JDBC 2.0 and CTS 2.2. I'd expect all vendors have a JDBC interface defined for their product and so this should be able to run within CICS. This would allow either static or dynamic SQL calls to be issued via the standard JDBC interface which means you can switch database vendors with a minimum of trouble as the JDBC interface is designed to be very general in character. You would simply write a Java class (one which starts with a main method and is defined to CICS via a RDO program object) and then XC LINK to it to do the foreign database activity.

Try to avoid doing a JNDI lookup. This will be bad news on the performance front. This is a trade off between strict portability (using JNDI/LDAP to get the address of the foreign database which is slow) and performance (hard-coding the info, much faster but with a potential maintenance penalty).

One thing to worry about is the UnitOfWork implications. The database UoW and the CICS UoW will probably be distinct so you could run into coordination and recovery problems.

Robert Harris
CICS Technical Strategist -- CICS expert at Search390.com

Editor's note: Do you agree with this expert's response? If you have more to share, post it in one of our .VO7aaqqaAFk.0@/search390>discussion forums.

Dig Deeper on IBM system z and mainframe systems

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.