Try Java in your environment

If you already have a CICS® environment, you can play with different functions using CICS-provided sample code.

This table summarizes the basic Java™ samples in CICS. Choose one that matches your learning objective to get started:

Table 1. Available samples
Learning objectives Samples
Understand the most common functions of the JCICS API
Understand the most common functions of the JCICSX API JCICSX samples
How to map data between Java and other languages, such as COBOL
Understand Spring Boot basics in CICS Java applications Spring Boot sample
How to access a database by using the Java Database Connectivity (JDBC) API JDBC web application sample

For each sample, find out where to get it, a brief description of what the sample does, and a summary of the Design choices for Java in CICS (or technologies) that it demonstrates.

JCICS samples

Find the samples: cics-java-jcics-samples

What you will learn:
  • Most common functions of the JCICS API, such as program linking, serialization, or accessing data from CICS transient data queues (TDQs), CICS temporary storage queues (TSQs), or VSAM files.
  • Deploy the application in a CICS bundle by using an Eclipse-based IDE with the IBM® CICS SDK for Java.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any Eclipse-based IDE with the IBM CICS SDK for Java installed, for example, CICS Explorer® OSGi Java SE OSGi bundle CICS bundle

RESTful web application sample

Find the sample: cics-java-liberty-restapp. You can also watch the video course that uses the sample: Developing a RESTful Web application for Liberty in CICS.

What you will learn:
  • Build and deploy a simple RESTful web application into a Liberty JVM server in CICS.
  • Link to a COBOL program from the Java application by using channels and containers.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any Eclipse-based IDE with WebSphere® Developer Tools and the IBM CICS SDK for Enterprise Java (Liberty) installed Liberty Java EE WAR CICS bundle

Extending RESTful web application sample

Find the sample: cics-java-liberty-restapp-ext. You can also find an accompanying video course in the sample repository.

What you will learn:
  • Access CICS resources, including VSAM files and temporary storage queues (TSQs) by using the JCICS API.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any Eclipse-based IDE with WebSphere Developer Tools and the IBM CICS SDK for Enterprise Java (Liberty) installed Liberty Java EE WAR CICS bundle

Link to Liberty sample

Find the sample: cics-java-liberty-link.

What you will learn:
  • Annotate a Java Liberty application to allow it to be called from a CICS program.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS CICS Explorer with the IBM CICS SDK for Enterprise Java (Liberty) installed Liberty Java EE WAR CICS bundle

JCICSX samples

Find the samples: cics-java-jcicsx-samples

What you will learn:
  • Basic functions of the JCICSX API, such as program linking, data passing, and mocking.
  • Customize the samples to use Gradle plug-in. Alternatively, build and deploy the application by using the CICS-provided Maven plug-in.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICSX Any Java IDE that supports Maven Liberty Java EE WAR CICS bundle (using Maven plug-in)
Did you know?: With JCICSX, you can debug the application code locally to check how your code will behave when running in CICS, by making remote calls into a CICS region. You can then deploy the application unchanged to a real CICS region. To set up JCICSX for remote development, see Java development using JCICSX.

IBM Record Generator sample

Find the sample: cics-java-recgen. You can read the tutorial that describes this sample in IBM Developer.

What you will learn:
  • Use IBM Record Generator for Java to generate Java helper classes from a COBOL copybook in a batch, and then use the generated Java classes to develop and deploy a Java application that links to a COBOL program.

Estimated time: 1 hour

Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any Eclipse-based IDE with the IBM CICS SDK for Java installed, in this case, CICS Explorer OSGi Java SE OSGi bundle CICS bundle

J2C sample

Find the sample: cics-java-j2cprog. You can read the tutorial that describes this sample in IBM Developer.

What you will learn:
  • Use the J2C tools in IBM Rational® Application Developer for WebSphere Software (RAD) to generate a Java data binding class from a COBOL copybook, and then use the generated Java class to develop and deploy a Java application that links to a COBOL program.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any Eclipse-based IDE with the IBM CICS SDK for Java installed OSGi Java SE OSGi bundle CICS bundle

Spring Boot sample

Find the sample: cics-java-liberty-springboot-jcics. You can read the tutorial that describes this sample in IBM Developer.

What you will learn:
  • Develop a basic Spring Boot application that uses the JCICS API to provide a RESTful CICS temporary storage queue (TSQ) browsing service.
  • Build the Spring Boot application by using Gradle or Maven to access libraries on Maven Central.
  • Deploy the application through either CICS Explorer or Liberty server configuration.

Estimated time: 1 hour

Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS Any IDE that supports Gradle or Maven Liberty Spring Boot WAR CICS bundle or Liberty configuration

JDBC web application sample

Find the sample: cics-java-liberty-jdbc

What you will learn:
  • Access a Db2® database from a web servlet in CICS Liberty through the Java Database Connectivity (JDBC) API.
Technologies used:
API IDE JVM server Application type Packaging Deployment
JCICS CICS Explorer with the IBM CICS SDK for Enterprise Java (Liberty) installed Liberty Java EE WAR CICS bundle

Where next?