EGL and IBM i Connectivity, Calling things, JDBC properties

Slides:



Advertisements
Similar presentations
Stored procedures and views You can see definitions for stored procedures and views in the demo databases but you can’t change them. For views, expand.
Advertisements

Using Eclipse. Getting Started There are three ways to create a Java project: 1:Select File > New > Project, 2 Select the arrow of the button in the upper.
® IBM Software Group © 2006 IBM Corporation Securing Your Application With WebSphere Security You will need to develop Login procedures for your web applications.
® IBM Software Group © 2006 IBM Corporation Additional AJAX Examples and Workshops This learning module provides additional AJAX use cases and examples.
® IBM Software Group © 2006 IBM Corporation EGL / SOA – Creating and Consuming EGL Web Services This Learning Module shows how to utilize the RBD tooling.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
® IBM Software Group © 2006 IBM Corporation How to read/write XML using EGL This Learning Module shows how to utilize an EGL Library to read/write an XML.
® IBM Software Group © 2006 IBM Corporation JSF Tab Controls This Learning Module shows how to develop server-side EGL applications with dynamic content.
® IBM Software Group © 2006 IBM Corporation EGL Calling RPG Programs This Learning Module shows how to use EGL to call RPG programs, running on System.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
® IBM Software Group © 2006 IBM Corporation Creating JSF/EGL Template Pages This section describes how to create.JTPL (Java Template Pages) using the Page.
Back to content Final Presentation Mr. Phay Sok Thea, class “2B”, group 3, Networking Topic: Mail Client “Outlook Express” *At the end of the presentation.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
® IBM Software Group © 2006 IBM Corporation JSF Tree Control This Learning Module describes the use of the JSF Tree Control – for hierarchical organization.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
Java Server Pages A JSP page is a text-based document that contains two types of text: static template data, which can be expressed in any text-based format,
In the next step you will enter some data records into the table. This can be done easily using the ‘Data Browser’. The data browser can be accessed via.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 2 of 4 – Creating the Business Logic Layer These slides walk you through the process.
® IBM Software Group © 2006 IBM Corporation Duplicating Your Workspace You may need to copy files from one workspace to another (example – you’ve developed.
IBM Software Group | Rational Software © 2003 IBM Corporation 1 iSeries – i5 Machine QSYSWRK SBS QZRCSRVSD (Remote Command Server - daemon) TCP/IP QUSRWRK.
® IBM Software Group © 2006 IBM Corporation Using JSF Mini-Calendar Controls This section describes how to use a JSF Mini-Calendar Control with EGL It.
® IBM Software Group © 2006 IBM Corporation Finding Out Which Submit Button Was Clicked – and Other JSF Command Button Techniques This section describes.
Gold – Crystal Reports Introductory Course Cortex User Group Meeting New Orleans – 2011.
® IBM Software Group © 2006 IBM Corporation EGL/Web Project QuickStart – 1 of 4 – Creating the Data Access Layer These slides walk you through the process.
® IBM Software Group © 2006 IBM Corporation JSF Panel – Section Controls This Learning Module shows how to develop server-side EGL applications with dynamic.
® IBM Software Group © 2006 IBM Corporation JSF Rich Text Area Component This Learning Module describes the use of the JSF Rich Text Area component – for.
This is how you invoke the Microsoft Visual Studio 2010 Software. All Programs >> Microsoft Visual Studio 2010.
IBM Software Group | Rational Software © 2007 IBM Corporation Access to System i and System z data Mark Evans
IBM Express Runtime Quick Start Workshop © 2007 IBM Corporation Deploying a Solution.
Entity Framework Database Connection with ASP Notes from started/getting-started-with-ef-using-mvc/creating-an-
Spell Checker web service (you build a web client that interacts with the service) The client uses a servlet class and a JSP page. The user passes information.
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
2 Copyright © 2004, Oracle. All rights reserved. Running a Forms Developer Application.
® IBM Software Group software © 2011 IBM Corporation Rational Business Developer v8 Services.
® IBM Software Group © 2006 IBM Corporation EGL.CSV (Excel) File Reading and Writing This section describes how to access.CSV (Excel Spreadsheet) files.
5/14/2003Sprint TekNet IP Train the Trainer1 Open TekNet Software If working at a client station, enter the IP address of the server and mark page as a.
1 © 2008 IBM Corporation Topic EGL Calls to Remote Programs (Overview)  EGL Calls to Remote Programs (Overview)  Calling RPG program  Calling a CL program.
® IBM Software Group © 2006 IBM Corporation Create EGL/JSF HelloWorld Pages This learning module walks you through the process of creating two simple “hello.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Labs: Create, deploy and test a simple web service
Dive Into® Visual Basic 2010 Express
Core ELN Training: Office Web Apps (OWA)
Business rules.
Data Virtualization Tutorial… SSL with CIS Web Data Sources
Running a Forms Developer Application
Creating Oracle Business Intelligence Interactive Dashboards
Business Directory REST API
IBM Rational Rhapsody Advanced Systems Training v7.5
Writing simple Java Web Services using Eclipse
Overview of SAMT Batch Upload
Introduction to Triggers
System I (AS400) Login You will need to develop Login procedures for your web applications. This short section describes how to do this for System I.
Using Procedures and Exception Handling
02 | Developing ASP.NET MVC 4 Models
Multi-host Internet Access Portal (MIAP) Enhancement Guide
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
MODULE 7 Microsoft Access 2010
Using JDeveloper.
System I (AS400) Login You will need to develop Login procedures for your web applications. This short section describes how to do this for System I.
European Computer Driving Licence
Part 1. Preparing for the exercises
Scripts In Matlab.
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
Planning a Group Policy Management and Implementation Strategy
Dynamically Populating a Multiple Selection List Box
Running a Java Program using Blue Jay.
Working with Libraries
Using Microsoft Outlook: Outlook Support Number
Presentation transcript:

EGL and IBM i Connectivity, Calling things, JDBC properties Claus Weiss weiss@ca.ibm.com

EGL and Remote Programs on IBM i Topic Sub-Topics: EGL Calls to Remote Programs (Overview) Calling programs on IBM i Invoking a command Invoking a procedure in a Service Program Dealing with members date fields on IBM i

Calling programs In this section you will learn how to call programs running on an IBM i. Here’s what you need to do: Add the iSeries JT400 toolkit to your project 2. (For each program to call) Add a callLink entry to the EGL Linkage Part for your Build File 3. Create the business logic to call the RPG Program First we will start with an overview of the system architecture and process  EGL Logic Part call program…

Calling RPG Programs - Overview Calling a RPG, COBOL, CL, or other program on the System i from EGL is as simple as coding: call “myProgram” (parm1, parmN); The facility is however extremely flexible and supports the many options that may be required to support many possible options and configurations. EGL takes into account the many possible runtime options that may affect how you run your jobs and call the RPG programs. EGL uses the System i Toolbox for Java™ to call programs on the System i. The toolbox in turn uses the i5/OS Remote Command server that is a part of the i5/OS Host Servers. The Remote Command server in i5/OS consists of a server daemon program that listens for TCP/IP requests from “clients”. This program is QZRCSRVSD which runs in the QSYSWRK sub-system. When the Remote Command Server starts, it starts a number of “worker” jobs that process requests in the QUSRSYS sub-system. These jobs are all named QZRCSRVS. The next slide describes this process in graphical and technical (in the Notes section) detail Note: When using pre-started jobs, UDATE will return date value of start of job not the date time of program start. Use timestamp at start of program to get system time at start of program

Calling RPG Programs – System Architecture Your EGL application calls programs through a series of Qxxx system modules, via the JT400.JAR (Java) toolbox If calling programs directly Property: remotePgmType: stateless or stateful red path Else generated COBOL call blue path Notes: In this lab you'll attempt to call an RPG program that is running on the IBM Dallas mainframe. To successfully test the call you need free and clear access to the internet. If you're running this lab inside a firewall-protected network there's a very good chance you will not be able to execute. You will however learn how to call RPG – and you should be able to transfer these steps to calling your own RPG modules in your shop. Note2. This slide illustrates the typical flow of a call from an EGL program to an i5/OS application program. In this scenario an EGL developer may be working on RDI SOA on their workstation and running an EGL application under the WebSphere Test Environment. The workstation will utilize the Java Toolbox to establish a connection with the Remote Command server on the System i QZRCSRVSD). The remote command server daemon (QZRCSRVSD) will locate an available work job (QZRCSRVS in the QUSRWRK sub-system). The user is authenticated. The SWAP ID API will be issued to switch the QZRCSRVS job from QUSERS to the ID passed in by EGL. The program QVGNSVR will be invoked. This program in turn will call the QVGNRNCL CL program that starts commitment control in the job (if required) and then call the QVGNSETP CL program to add any required libraries to the job’s library list. In RBD 7.1 two additional properties on the lnakage file have been introduced that allow to directly call an IBM i program without using the QVGNRNCL program, the two properties are: Stateful Stateless These are only valid on IBM i for programs not generated by EGL and you will need to specify the property remoteComType JAVA400 in order to use them. When using stateless or stateful, you will not need the QEGL library and any of the QVGN* programs on your IBM i system. Finally the user program will be called. Return parameters will be returned up the path back to the invoking EGL program. You can find the QEGL library in a savefile in the RDI SOA install directories Use RSE to access your local directories and copy the savefile using copy/paste in the RSE tree view to your IBM i system. Restore the library. If calling COBOL on the i

EGL and Remote Programs on IBM i Topic Sub-Topics: EGL Calls to Remote Programs (Overview) Calling programs on IBM i Invoking a command Invoking a procedure in a Service Program Dealing with members date fields on IBM i

Calling programs – Steps (Revisited)  Here’s what you need to do: One time step Add the iSeries JT400 toolkit to your project and Java Build Path Once per project Add an EGL Linkage Part for external programs Once for each program to call For each program add a callLink element For each call - Code the business logic to call the RPG Program, from an EGL “client” logic part: - Service - JSFHandler - Program - Library

 Add the JT400 Toolkit to your Project Calling RPG programs on an iSeries box requires the JT400 toolkit in your build path. There are 2 ways to do this (you only need to do one of these) 1. Add the file to the build path Right-click over your project and select Properties In the window that pops up, select Java Build Path on the left side of the screen Select Add External Jars… Find the jt400.jar file on your pc, select Open, Select OK to close the properties window. 2. Put the file in the WEB-INFLib folder. Switch to the Resource perspective Expand Web Content  WEB-INF  lib folder Drag jt400.jar into this folder  Drag Here

 Add to the Build File’s Linkage Option – 1 of 2 From Project Explorer, Open EGLWeb.eglbld using the EGL Build Parts Editor From the Window menu, open the Outline View Add a linkage part for the project From the externalPrograms part: Click: Add In the CallLink Elements: Name the program: RPG1 Type: remoteCall Enter the following properties: Alias: RPGCLSP1 conversionTable (type): CSOE037 Library: EGLPOT location (type): iseriesd.demos.ibm.com luwControl (select): SERVER remoteBind: GENERATION /runtime remoteComType (select): JAVA400 remotePgmType (select): STATELESS Close and Save your Linkage Options – and Close/Save the Build File Note: if you specify remotePgmType stateless or stateful you will not need QEGL on IBM i

 Add to the Build File’s Linkage Option – 2 of 2 From Project Explorer, Right-Click over EGLWeb.eglbld and select: Open with Text editor Scroll down to the line <remoteCall pgmName=“RPG1”… Click your mouse at the beginning of the line (to set focus) Press Shift/End – to select the entire line (see reverse video line below) Press Ctrl/C – to copy the line Enter a new line, and press Ctrl/V 3 times – to copy/paste the entire line three times Modify the pgmName’s and Alias’ in the new lines to: RPG2 RPGCLSP2 RPG3 RPGCLSP3 RPG4 RPGZIPCK Close and save your edits Note that you may not have the <remoteCall… pgmName=“CBLCL..” entries, unless you have done the “Calling COBOL” workshop (prior section of this course)

2. Replicate the Linkage Options for Additional Programs – 3 of 3 Close and save your edits to the Linkage Options Open EGLWeb.eglbld with the EGL Build Parts Editor Un-check: Show only specified options From the linkage Option, open the drop-down list and select:externalPrograms Close and save your Build file Right-click over your EGLWeb project and Generate

3. EGL Program Calls to IBM i So – you can see from this example, that there is nothing complex whatsoever about calling programs from EGL. This JSFHandler has several different scenarios: Passing individual parameters to RPG Passing a single record Passing a record that contains an array Here are the record definitions Fixed records are required Fixed arrays are required

EGL and Remote Programs on IBM i Topic Sub-Topics: EGL Calls to Remote Programs (Overview) Calling programs on IBM i Invoking a command Invoking a procedure in a Service Program Dealing with date fields on IBM i members

Invoking IBM i comands – Steps  Here’s what you’ll do: The steps for invoking commands on IBM i is similar as for calling a program, but the linkage part needs to point to the QCMDEXC program. One time step - Add the iSeries JT400 toolkit to your project and Java Build Path For this step, follow the instructions for calling an RPG program Once in a project for external calls - Add an EGL Linkage Part for the QCMDEXC program For each call to QCMDEXC - Code the logic to add the command string as a parameter and to call the QCMDEXC Program, from an EGL “client” logic part: - Service - JSFHandler - Program - Library A invoke a IBM i command you need to call program QCMDEXC the rest is the same as a call to an RPG, CL, or COBOL program. The eglbld file will contain the info to invoke QCMDEXC when the call to COMMANDONI is done. The parameter contain the command info. You go thru the same steps, to create the linkage entry and do the Call in your EGL logic.

 Add to the Build File’s Linkage Option From Project Explorer, Open the .eglbld file using the EGL Build Parts Editor From the Window menu, open the Outline View (It should be located at the bottom left corner of the tool, next to “Page Data” View) From the Outline View, select “externalPrograms” (you should have created this during the calling Cobol workshop) From the externalPrograms part: Click: Add In the CallLink Elements: Name the program: COMANDONI Type: remoteCall Enter the following properties: Alias: QCMDEXC conversionTable (type): CSOE037 Library: %LIBL% location (type): iseriesd.demos.ibm.com luwControl (select): SERVER remoteBind: GENERATION remoteComType (select): JAVA400 remotePgmType (select): STATEFUL Close and Save your Linkage Options – and Close/Save the Build File The call will call COMANDONI but the linkage file contains the info that this call should invoke QCMDEXC the command to invoke is passed as a parameter. Make sure to not invoke commands that try to display a 5250 screen, you will get an exception.

EGL and Remote Programs on IBM i Topic Sub-Topics: EGL Calls to Remote Programs (Overview) Calling programs on IBM i Invoking a command Invoking a procedure in a Service Program Dealing with members date fields on IBM i

Invoking a procedure in a Service Program – Steps  Here’s what you need to do: The steps for invoking procedures are different than for calling a program, no linkage part is need instead you will use a deployment descriptor instead. No Call statement is needed instead you invoke the procedure like a function, the procedure interface is described in an EGL interface. One time step - Add the iSeries JT400 toolkit to your project and Java Build Path Once for each procedure to invoke - Add an EGL deployment descriptor entry For each invocation - Code the business logic to call the RPG Program, from an EGL “client” logic part: - Service - Interface - JSFHandler - Program - Library A procedure invocation is very different from a call to a program. You go thru different steps, you need to create an entry in the deployment descriptor You will also need to create an EGL Interface that describes interface of the procedure

 Add to the Service Client binding From Project Explorer, in the EGLSource folder: Open the .egldd file using the EGL Build Parts Editor Select the Service Client Bindings Tab From the Service Bindings Configuration dialog Click the ADD button Select the Native binding Radio button On the Add Native Binding Dialog Enter the following attributes: conversionTable (type): CSOE037 Library: EGLPOT location (type): iseriesd.demos.ibm.com Userid(type): EGL4RPG Password(type): EGL4YOU Press the Finish button Close and Save your Deployment Descriptor –

4. Create the Interface for procedure invocation Before finishing the project you need to create the EGL interface Right-click over the \EGLSource\ folder and select New  Interface Package name: Interfaces EGL sourec file name: getdssol package Interfaces; import basicrecords.cstruc; // interface interface getdssol function getrecord(custnoi char(7),myds cstruc, fdback char(20)) ; end package basicrecords; //Put EGL Source File Contents Here record cstruc 10 custno char(7); 10 custna char(40); 10 repno char(5); 10 contac char(30); 10 cphone char(17); 10 cfax char(17); 10 caddr char(40); 10 ccity char(30); 10 ccount char(20); 10 czip char (10); 10 cziplo char(1); end

EGL and Remote Programs on IBM i Topic Sub-Topics: EGL Calls to Remote Programs (Overview) Calling programs on IBM i Invoking a command Invoking a procedure in a Service Program Dealing with members date fields on IBM i

 Accessing members in data base files How to access members in data base files : Create an SQL Alias Use an SQL statement in your EGL Use SQL on i to create the alias Alias is an Sample use SQL Alias statement to create : CREATE ALIAS QLINK FOR WFLABXX/MYFILE(mymember) SQL name also works WFLABXX.MYFILE(mymember) Alias will show in RSE as well as OPS Navigator Use SQL Select statement with Alias name select * from WFLABXX/QLINK

Some notes for accessing DB2 on i In the jdbc data source when working with yyyy Specify these properties: dateformat : iso timeformat: iso Setting a date to 0001-01-01 Assign in EGL = “01/01/0001” ; use Quotes Or assign NULL, to Null the date field One more: For working with the library list, use Naming: system package jsfhandlers; import com.ibm.egl.jsf.*; handler lookatmember type JSFHandler {onConstructionFunction = onConstruction, onPrerenderFunction = onPrerender, view = "lookatmember.jsp", viewRootVar = viewRoot} qdds Qddssrc[0]; memberalias string; membername string = "QDSIGNON2"; viewRoot UIViewRoot; // Function Declarations function onConstruction() end function onPrerender() function getNewMember() // Use prepare statement for ALIAS create to be able to use dynamic member name memberalias = "CREATE ALIAS QEGL.QLINK FOR QGPL.QDDSSRC(" + membername + ")"; prepare myAliasstmt FROM memberalias; // execute the prepared statement execute myAliasstmt; // run the SQL get qdds with #sql{ select * from QEGL.QLINK}; // Delete the alias execute #sql{drop QEGL.QLINK}; record Qddssrc type sqlRecord { tablenames=[["QEGL.QDDSSRC"]], keyItems=[SRCSEQ] } SRCSEQ DECIMAL(6, 2) ; SRCDAT DECIMAL(6, 0); SRCDTA CHAR(80);