5. Using Java to Access CA-Datacom

Embed Size (px)

Citation preview

  • 7/27/2019 5. Using Java to Access CA-Datacom

    1/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    The simple way to have

    Java applications withCA-Datacom

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

  • 7/27/2019 5. Using Java to Access CA-Datacom

    2/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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 introducesthese benefits to the non-Java audience, and

    shows how these benefits can be further enhanced

    by linking with CA-Datacom.

  • 7/27/2019 5. Using Java to Access CA-Datacom

    3/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Agenda

    What is Java?

    Accessing CA-Datacom from Java

    Demo of doing this the easy way!

    Why do it?

    Summary

  • 7/27/2019 5. Using Java to Access CA-Datacom

    4/36managed & organised by QED Business Systemssponsored by Computer Associates

    What is Java?

  • 7/27/2019 5. Using Java to Access CA-Datacom

    5/36managed & organised by QED Business Systemssponsored by Computer Associates

    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

  • 7/27/2019 5. Using Java to Access CA-Datacom

    6/36managed & organised by QED Business Systemssponsored by Computer Associates

    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

  • 7/27/2019 5. Using Java to Access CA-Datacom

    7/36managed & organised by QED Business Systemssponsored by Computer Associates

    Java Background

    Massive marketing by Sun

    Arrival of world wide web

    Requirement for architecture-neutral language

    Vast body of technical expertise

  • 7/27/2019 5. Using Java to Access CA-Datacom

    8/36managed & organised by QED Business Systemssponsored by Computer Associates

    Java Features

    Simple language similar to C++

    Object-oriented focus on data & interface

    Distributed

    Robust, Secure

  • 7/27/2019 5. Using Java to Access CA-Datacom

    9/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    More Java Features

    Architecture-neutral

    Portable

    Interpreted

    High performance, Multi threaded

    Dynamic

  • 7/27/2019 5. Using Java to Access CA-Datacom

    10/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Java Terms & Concepts

    Objects everything is considered an object

    Classes a particular type of object

    Encapsulation combining data & code intoa single object

    Inheritance the derivation of one class fromanother

    Polymorphism ability to assume several

    different forms or shapes; the ability of a singlevariable to invoke different methods,

    depending upon what the variable contains

  • 7/27/2019 5. Using Java to Access CA-Datacom

    11/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Java Basics

    Source code

    Compiler

    Byte Codes

    Interpreter

    App.java

    Javac App.java

    App.class

    Windows

    Java VM

    Linux

    Java VM

    z/OS

    Java VM

  • 7/27/2019 5. Using Java to Access CA-Datacom

    12/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    My first Java program

    Program container

    public class Hello { }

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

    Statement

    System.out.println(Hello World);

  • 7/27/2019 5. Using Java to Access CA-Datacom

    13/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Java Platform

    Java Virtual Machine

    Java API

  • 7/27/2019 5. Using Java to Access CA-Datacom

    14/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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

  • 7/27/2019 5. Using Java to Access CA-Datacom

    15/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Accessing CA-Datacom fromJava

  • 7/27/2019 5. Using Java to Access CA-Datacom

    16/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    JDBC

    Java Database Connectivity

    API

    Provides data access for Java programminglanguage

    Complex, multi-tiered architecture

  • 7/27/2019 5. Using Java to Access CA-Datacom

    17/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    JDBC Flow Type II Connection

    PC PlatformJava application

    CA-Datacom Server JDBC Driver

    CA CCI

    CA CCI

    CA-Datacom Server

    CA-Datacom

    Mainframe Platform

  • 7/27/2019 5. Using Java to Access CA-Datacom

    18/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    JDBC Flow Type IV Connection

    Mainframe Platform

    CA CCI

    CA-Datacom Server

    CA-Datacom

    PC Platform

    Java application

    CA-Datacom JDBC

    Proxy

    PC Platform

    CA-Datacom Java Server

    (NT service, Linux)

    CA-Datacom Server

    JDBC Driver

    CA CCI

  • 7/27/2019 5. Using Java to Access CA-Datacom

    19/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    JDBC Flow z/OS Unix

    Mainframe Platform

    CA CCI

    CA-Datacom Server

    CA-Datacom

    Java application

    CA-Datacom Server JDBC Driver

    CA CCI

  • 7/27/2019 5. Using Java to Access CA-Datacom

    20/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    HTTP/XML Flow

    PC PlatformJava application

    Mainframe Platform

    CICS & FireXML for CA-Datacom

    CA-Datacom

  • 7/27/2019 5. Using Java to Access CA-Datacom

    21/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Demo of accessingCA-Datacom from Java

  • 7/27/2019 5. Using Java to Access CA-Datacom

    22/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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

  • 7/27/2019 5. Using Java to Access CA-Datacom

    23/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    CA-Datacom

    Demo architecture

    Sysadm

    .Cust

    Sysadm

    .Orders

    Sysadm

    .Items

    Sysadm

    .Detail

    Order-entry (dbid 010)

    CICS

    FireXML

    internet

    Windows XP

    Java VM

    QED mainframe

  • 7/27/2019 5. Using Java to Access CA-Datacom

    24/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    FireXML processing

    DBMS

    zOS,

    OS390, VSE

    mainframe

    CICS

    FireXMLBroker

    browser,

    web serverapplication(Java, Perl, C#,

    C++, VB, ASP)

    MR SMI TH

    1 HI GH STREETANYTOWN

    4. HTTP/XML

    output document

    SELECT NAME, ADDRESSFROM CUSTOMER WHERECUST_I D = 1234

    2. SQL statement validated

    and passed to DBMS

    MR SMI TH , 1 HI GH STREETANYTOWN

    3. DBMS returns

    result set

    SELECT NAME, ADDRESSFROM CUSTOMER WHERECUST_I D = 1234

    1.. HTTP/SQL

    input statement

    existing 3270 applications

  • 7/27/2019 5. Using Java to Access CA-Datacom

    25/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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;

  • 7/27/2019 5. Using Java to Access CA-Datacom

    26/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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;";

    J di 3

  • 7/27/2019 5. Using Java to Access CA-Datacom

    27/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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();

    J di 4

  • 7/27/2019 5. Using Java to Access CA-Datacom

    28/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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();

    Th d

  • 7/27/2019 5. Using Java to Access CA-Datacom

    29/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    The demo

    JavaDatacom demo.lnk

    http://../FireXML/Demos/SalesDemo/salesdemo.bathttp://../FireXML/Demos/SalesDemo/salesdemo.bat
  • 7/27/2019 5. Using Java to Access CA-Datacom

    30/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    What does this all mean?

    O ti l i

  • 7/27/2019 5. Using Java to Access CA-Datacom

    31/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Operational issues

    Installation & configuration

    Concurrent usage

    Security Performance

    Maintenance & support

    Integration benefits

  • 7/27/2019 5. Using Java to Access CA-Datacom

    32/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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)

    Further info

  • 7/27/2019 5. Using Java to Access CA-Datacom

    33/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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 & tipshttp://www-

    1.ibm.com/servers/eserver/zseries/software/java/javafaq.html Java Programming Guide for z/OS Redbookhttp://publib-

    b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDoc

    ument&Highlight=0,Java

    More links

    http://www-1.ibm.com/servers/eserver/zseries/software/javahttp://www-1.ibm.com/servers/eserver/zseries/software/java/javafaq.htmlhttp://www-1.ibm.com/servers/eserver/zseries/software/java/javafaq.htmlhttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://publib-b.boulder.ibm.com/Redbooks.nsf/9445fa5b416f6e32852569ae006bb65f/1f8767e73398d70085256760007b9ac1?OpenDocument&Highlight=0,Javahttp://www-1.ibm.com/servers/eserver/zseries/software/java/javafaq.htmlhttp://www-1.ibm.com/servers/eserver/zseries/software/java/javafaq.htmlhttp://www-1.ibm.com/servers/eserver/zseries/software/java
  • 7/27/2019 5. Using Java to Access CA-Datacom

    34/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    More links

    Sun

    http://java.sun.com

    FireXML http://www.firexml.com

    General http://www.java.net

    Session Summary

    http://java.sun.com/http://www.firexml.com/http://www.java.net/http://www.java.net/http://www.firexml.com/http://java.sun.com/
  • 7/27/2019 5. Using Java to Access CA-Datacom

    35/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    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!

  • 7/27/2019 5. Using Java to Access CA-Datacom

    36/36

    managed & organised by QED Business Systemssponsored by Computer Associates

    Tea