You are on page 1of 36

The simple way to have Java applications with CA-Datacom

Need a GUI interface to your CA-Datacom data? This is the easy way!

sponsored by Computer Associates

managed & organised by QED Business Systems

Abstract
Theres no reason why developers of non-mainframe applications shouldnt benefit from using data in mainframe CA-Datacom. This session explains a straight-forward and highly effective approach to having Java applications that can access and maintain data in mainframe CA-Datacom. Users prefer GUI interfaces to mainframe green screens, and using Java brings many benefits to application development. This session introduces these benefits to the non-Java audience, and shows how these benefits can be further enhanced by linking with CA-Datacom.
sponsored by Computer Associates managed & organised by QED Business Systems

Agenda
What is Java? Accessing CA-Datacom from Java Demo of doing this the easy way! Why do it? Summary

sponsored by Computer Associates

managed & organised by QED Business Systems

What is Java?

sponsored by Computer Associates

managed & organised by QED Business Systems

What is Java?
Programming language Runtime system Development tools Java Virtual Machine Interpreter Executes byte codes Standard class file format Ported to many hardware platforms

sponsored by Computer Associates

managed & organised by QED Business Systems

A brief history of Java


1990 - James Gosling & colleagues, Sun Microsystems, develop Oak 1995 Java freely available from Sun 1998 Java 2 incorporates additional features

sponsored by Computer Associates

managed & organised by QED Business Systems

Java Background
Massive marketing by Sun Arrival of world wide web Requirement for architecture-neutral language Vast body of technical expertise

sponsored by Computer Associates

managed & organised by QED Business Systems

Java Features
Simple language similar to C++ Object-oriented focus on data & interface Distributed Robust, Secure

sponsored by Computer Associates

managed & organised by QED Business Systems

More Java Features


Architecture-neutral Portable Interpreted High performance, Multi threaded Dynamic

sponsored by Computer Associates

managed & organised by QED Business Systems

Java Terms & Concepts


Objects everything is considered an object Classes a particular type of object Encapsulation combining data & code into a single object Inheritance the derivation of one class from another Polymorphism ability to assume several different forms or shapes; the ability of a single variable to invoke different methods, depending upon what the variable contains
sponsored by Computer Associates managed & organised by QED Business Systems

Java Basics
Source code
App.java

Compiler
Javac App.java

Byte Codes Interpreter


Java VM Windows
sponsored by Computer Associates

App.class

Java VM Linux

Java VM z/OS

managed & organised by QED Business Systems

My first Java program

Program container
public class Hello { }

Main method
public static void main (String[] args) { }

Statement
System.out.println(Hello World);
sponsored by Computer Associates managed & organised by QED Business Systems

Java Platform

Java Virtual Machine Java API

sponsored by Computer Associates

managed & organised by QED Business Systems

A few Java definitions


J2EE Java 2 Enterprise Edition
used to develop, deploy & manage multi-tier, server centric applications

J2ME Java 2 Micro Edition


Java platform for embedded devices (cellphones & PDAs)

J2SE Java 2 Standard Edition Javascript


Embedded as small program in web page to control appearance & action of browser

sponsored by Computer Associates

managed & organised by QED Business Systems

Accessing CA-Datacom from Java

sponsored by Computer Associates

managed & organised by QED Business Systems

JDBC
Java Database Connectivity API Provides data access for Java programming language Complex, multi-tiered architecture

sponsored by Computer Associates

managed & organised by QED Business Systems

JDBC Flow Type II Connection


PC Platform Java application CA-Datacom Server JDBC Driver CA CCI CA CCI CA-Datacom Server CA-Datacom Mainframe Platform
sponsored by Computer Associates managed & organised by QED Business Systems

JDBC Flow Type IV Connection


PC Platform Java application CA-Datacom JDBC Proxy PC Platform CA-Datacom Java Server (NT service, Linux) CA-Datacom Server JDBC Driver CA CCI CA CCI CA-Datacom Server CA-Datacom Mainframe Platform
sponsored by Computer Associates managed & organised by QED Business Systems

JDBC Flow z/OS Unix


Java application CA-Datacom Server JDBC Driver CA CCI CA CCI CA-Datacom Server CA-Datacom Mainframe Platform
sponsored by Computer Associates managed & organised by QED Business Systems

HTTP/XML Flow
PC Platform Java application

CICS & FireXML for CA-Datacom CA-Datacom Mainframe Platform


sponsored by Computer Associates managed & organised by QED Business Systems

Demo of accessing CA-Datacom from Java

sponsored by Computer Associates

managed & organised by QED Business Systems

Using the HTTP/XML approach


Simple architecture Minimal installation Nominal ongoing administration Standard Java programming techniques Direct access to data in CA-Datacom Robust High performance

sponsored by Computer Associates

managed & organised by QED Business Systems

Demo architecture
CICS QED mainframe CA-Datacom Order-entry (dbid 010) Sysadm .Cust internet
Windows XP Java VM
FireXML

Sysadm .Orders Sysadm .Items Sysadm .Detail

sponsored by Computer Associates

managed & organised by QED Business Systems

FireXML processing
existing 3270 applications

SELECT NAME, ADDRESS FROM CUSTOMER WHERE CUST_ID = 1234

CICS
FireXML Broker

SELECT NAME, ADDRESS FROM CUSTOMER WHERE CUST_ID = 1234

1.. HTTP/SQL input statement

2. SQL statement validated and passed to DBMS DBMS

4. HTTP/XML output document

browser, web server application


(Java, Perl, C#, C++, VB, ASP)

<NAME>MR SMITH</NAME> <ADDRESS>1 HIGH STREET ANYTOWN </ADDRESS>

3. DBMS returns result set


MR SMITH, 1 HIGH STREET ANYTOWN

zOS, OS390, VSE mainframe

sponsored by Computer Associates

managed & organised by QED Business Systems

Java coding 1
Import packages
import java.net.*; import java.util.*; import org.xml.sax.InputSource; import org.w3c.dom.*; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.dom.DOMSource;

sponsored by Computer Associates

managed & organised by QED Business Systems

Java coding 2
Declare variables
private String URL = "qed_mf1:3000"; /* Default FireXML mainframe */ private String initSQL = "Select distinct STATE from sysadm.cust order by STATE;";

sponsored by Computer Associates

managed & organised by QED Business Systems

Java coding 3
Code connection URL
HttpURLConnection urlConn = (HttpURLConnection) url.openConnection(); urlConn.setDoOutput(true); urlConn.setDoInput(true); urlConn.setRequestMethod("POST"); urlConn.setRequestProperty("Content-length", Integer.toString(requestBody.length())); OutputStream os = urlConn.getOutputStream(); OutputStreamWriter out= new OutputStreamWriter(os); out.write(requestBody); out.flush(); out.close();
sponsored by Computer Associates managed & organised by QED Business Systems

Java coding 4
DOM processing
DOMParser parser = new DOMParser(); ByteArrayInputStream xmlIS = new ByteArrayInputStream( XML.getBytes()); try {statusUpdate("XML received from mainframe - parse the XML"); parser.parse( new InputSource(xmlIS) ); document=parser.getDocument();

sponsored by Computer Associates

managed & organised by QED Business Systems

The demo

JavaDatacom demo.lnk

sponsored by Computer Associates

managed & organised by QED Business Systems

What does this all mean?

sponsored by Computer Associates

managed & organised by QED Business Systems

Operational issues
Installation & configuration Concurrent usage Security Performance Maintenance & support

sponsored by Computer Associates

managed & organised by QED Business Systems

Integration benefits
Standard code with GUI interfaces Use existing CA-Datacom data Use of Java IDEs (eg. .Net, Sun ONE, Eclipse, Borland Jbuilder, Websphere Development Studio)

sponsored by Computer Associates

managed & organised by QED Business Systems

Further info
IBM Java support links Java 2 on the z/OS platform
http://www-1.ibm.com/servers/eserver/zseries/software/java

Java on z/OS hints & tips


http://www1.ibm.com/servers/eserver/zseries/software/java/javafaq.html

Java Programming Guide for z/OS Redbook


http://publibb.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569a e006bb65f/1f8767e73398d70085256760007b9ac1?OpenDoc ument&Highlight=0,Java

sponsored by Computer Associates

managed & organised by QED Business Systems

More links
Sun http://java.sun.com FireXML http://www.firexml.com General http://www.java.net

sponsored by Computer Associates

managed & organised by QED Business Systems

Session Summary
What is Java? Accessing CA-Datacom from Java Demonstration of HTTP/XML approach Combining the benefits of Java with the benefits of CA-Datacom Using standard HTTP and XML

The easy way!


sponsored by Computer Associates managed & organised by QED Business Systems

Tea

sponsored by Computer Associates

managed & organised by QED Business Systems

You might also like