System i Windows Integration Solutions

Similar documents
NEMUG Feb Create Your Own Web Data Mart with MySQL

Advanced SQL. Jim Mason. Web solutions for iseries engineer, build, deploy, support, train

Package sjdbc. R topics documented: February 20, 2015

Getting Started using the SQuirreL SQL Client

Lucid Key Server v2 Installation Documentation.

Lecture 2. Internet: who talks with whom?

CatDV Pro Workgroup Serve r

Supplement IV.C: Tutorial for Oracle. For Introduction to Java Programming By Y. Daniel Liang

PHP on IBM i: What s New with Zend Server 5 for IBM i

Developing XML Solutions with JavaServer Pages Technology

Microsoft SQL Server Features that can be used with the IBM i

How to Improve Database Connectivity With the Data Tools Platform. John Graham (Sybase Data Tooling) Brian Payton (IBM Information Management)

PHP Batch Jobs on IBM i. Alan Seiden Consulting alanseiden.com

Using DOTS as Apache Derby System Test

Gothenburg Mainframe and Continuous Integration. Jan Marek com. CA Technologies. Session S610

NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide

PDQ-Wizard Prototype 1.0 Installation Guide

CERTIFIED MULESOFT DEVELOPER EXAM. Preparation Guide

CA Workload Automation Agent for Databases

A Brief Introduction to MySQL

WebFacing and HATS overview

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

IBM Campaign Version-independent Integration with IBM Engage Version 1 Release 3 April 8, Integration Guide IBM

Module 4: File Reading. Module 5: Database connection

Customer Bank Account Management System Technical Specification Document

Short notes on webpage programming languages

Getting started with OWASP WebGoat 4.0 and SOAPUI.

COMMON All Day Lab 10/16/2007 Hands on VB.net and ASP.Net for iseries Developers

IBM DB2 XML support. How to Configure the IBM DB2 Support in oxygen

Intruduction to Groovy & Grails programming languages beyond Java

LICENSE4J AUTO LICENSE GENERATION AND ACTIVATION SERVER USER GUIDE

Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Abstract. Introduction. Web Technology and Thin Clients. What s New in Java Version 1.1

Version Overview. Business value

Continuous Integration Part 2

Government Girls Polytechnic, Bilaspur

Apache Derby Security. Jean T. Anderson

Overview of Databases On MacOS. Karl Kuehn Automation Engineer RethinkDB

1 Introduction: Network Applications

Important Release Information and Technical and Deployment Support Notes

Enterprise Application Development In Java with AJAX and ORM

Clustering a Grails Application for Scalability and Availability

Tool-Assisted Knowledge to HL7 v3 Message Translation (TAMMP) Installation Guide December 23, 2009

Portals, Portlets & Liferay Platform

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports

Still Aren't Doing. Frank Kim

DB2 Web Query Interfaces

Tutorial for Spring DAO with JDBC

Cabot Consulting Oracle Solutions. The Benefits of this Approach. Infrastructure Requirements

Web Express Logon Reference

Accessing Your Database with JMP 10 JMP Discovery Conference 2012 Brian Corcoran SAS Institute

Using the SQL TAS v4

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Web Services API Developer Guide

WIRIS quizzes web services Getting started with PHP and Java

Modern Software Development Tools on OpenVMS

Business as usual...

G563 Quantitative Paleontology. SQL databases. An introduction. Department of Geological Sciences Indiana University. (c) 2012, P.

Load Testing with JMeter

MySQL Command Syntax

DiskPulse DISK CHANGE MONITOR

Dove User Guide Copyright Virgil Trasca

Installation Manual v2.0.0

JDBC. It is connected by the Native Module of dependent form of h/w like.dll or.so. ex) OCI driver for local connection to Oracle

Subversion Integration

Services. Relational. Databases & JDBC. Today. Relational. Databases SQL JDBC. Next Time. Services. Relational. Databases & JDBC. Today.

Appium mobile test automation

How to make a good Software Requirement Specification(SRS)

Driver for JDBC Implementation Guide

The full setup includes the server itself, the server control panel, Firebird Database Server, and three sample applications with source code.

EC-Council CAST CENTER FOR ADVANCED SECURITY TRAINING. CAST 619 Advanced SQLi Attacks and Countermeasures. Make The Difference CAST.

from Microsoft Office

Cloud Elements! Marketing Hub Provisioning and Usage Guide!

Migrating helpdesk to a new server

2 SQL in iseries Navigator

Oracle Forms Services Secure Web.Show_Document() calls to Oracle Reports Server 6i

Working With Derby. Version 10.2 Derby Document build: December 11, 2006, 7:06:09 AM (PST)

Consuming and Producing Web Services with WST and JST. Christopher M. Judd. President/Consultant Judd Solutions, LLC

How To Use The Listerv Maestro With A Different Database On A Different System (Oracle) On A New Computer (Orora)

STREAMEZZO RICH MEDIA SERVER

Oracle Business Intelligence Publisher. 1 Oracle Business Intelligence Publisher Certification. Certification Information 10g Release 3 (

agileworkflow Manual 1. agileworkflow 2. The repository 1 of 29 Contents Definition

database abstraction layer database abstraction layers in PHP Lukas Smith BackendMedia

J j enterpririse. Oracle Application Express 3. Develop Native Oracle database-centric web applications quickly and easily with Oracle APEX

Accessing External Databases from Mobile Applications

Database Administration with MySQL

1 Introduction. 3 Open Mobile IS components 3.1 Embedded Database 3.2 Web server and Servlet API 3.3 Service API and template engine

Introduction to Web services for RPG developers

COSC 6397 Big Data Analytics. 2 nd homework assignment Pig and Hive. Edgar Gabriel Spring 2015

SQL Server An Overview

CS506 Web Design and Development Solved Online Quiz No. 01

How to consume a Domino Web Services from Visual Studio under Security

Programming Database lectures for mathema

IBM Power Systems Software. The ABCs of Coding High Performance SQL Apps DB2 for IBM i. Presented by Jarek Miszczyk IBM Rochester, ISV Enablement

Instant Chime for IBM Sametime Installation Guide for Apache Tomcat and Microsoft SQL

System requirements. Java SE Runtime Environment(JRE) 7 (32bit) Java SE Runtime Environment(JRE) 6 (64bit) Java SE Runtime Environment(JRE) 7 (64bit)

Overview of Web Services API

Transcription:

System i Windows Integration Solutions Jim Mason Cape Cod Bay Systems Quick Web Solutions jemason@ebt-now.com 508-728-4353 NEMUG - 2011

What we'll cover Introduction Windows Integration use cases Windows Integration toolset Integration scenarios listed Read and write data from Windows to IBM i Send / receive files from Windows to IBM i Call CL / RPG programs from Windows Call batch Windows applications from IBM i Automate Office applications Talking Data Send mail Run Windows tasks Remote access Web services Web collaboration Windows integration summary Next steps

WIT Windows Integration Trivia WIT a trivia game WIT Rules My answers are always the right answer Prizes are almost awesome ( slight exaggeration ) 8 questions total Full disclosure my idea of a fun game and yours MAY NOT overlap!

1 What is a key criteria for evaluating Windows integration solutions?

2 What is a key example of Windows integration?

Introduction Goal: Link the System i and Windows servers, apps, data Key measures for Windows Integration solutions fits our needs productive, simple short learning curve maximum ROI with portability, flexibility, reuse, standards minimum risks for: vendor, product, business, project, technical Strategy use what you have now where it's the best solution RPG, CL, DB2/400, Java, Java toolkit, iseries Access Strategy buy or build solutions? Traditional buy software tools and try to integrate New - Leverage existing software, skills where possible Use standard, open-source COTS parts to glue solutions together Get trained for new tools ( self study, classes workshops or?)

Software needed by server What's needed for the usage scenarios reviewed On Windows server Microsoft Office,.Net, Microsoft SQL Server database Scriptom: the COM ActiveXObject framework for Groovy On IBM i server RPG and CL pgms, DB2/400, more IBM Java toolkit: JDBC driver for SQL, ProgramCall to call RPG, CLP On either server Java Groovy Grails Apache Tomcat server Apache JSPWiki Apache HTTP server Apache FTP server

Read, write data with SQL, JDBC, Groovy import groovy.sql.* Groovy writes selected SQL data to print easily Use the right JDBC jar file for the specific database ( Derby below) Create simple database connection, get a result set from a select statement and print it SQL List example from Scott Davis article at IBM Web site def sql = Sql.newInstance( "jdbc:derby://localhost:1527/mydbtest;create=true","username","password","or g.apache.derby.jdbc.clientdriver") println("print all fields on query below") sql.eachrow("select * from languages"){ row -> println("name: ${row.name} Url: ${row.url}") }

More SQL examples Now you can invoke sql, e.g. to create a table: sql.execute ''' create table PROJECT ( id integer not null, name varchar(50), url varchar(100) ) ''' Or insert a row using GString syntax: def map = [id:20, name:'grails', url:'http://grails.codehaus.org'] sql.execute "insert into PROJECT (id, name, url) values ($map.id, $map.name, $map.url)" Or a row update: def newurl = 'http://grails.org' def project = 'Grails' sql.executeupdate "update PROJECT set url=$newurl where name=$project" Or use a Groovy SQL dataset for insert, update, delete no SQL! import groovy.sql.* sql = Sql.newInstance( "jdbc:mysql://localhost:3306/sample?allowmultiqueries=true", "root", " ", "com.mysql.jdbc.driver") dataset = new DataSet(sql,'tasks') dataset.add(taskname:'setup',owner:'johnson')

Use DB Stored procs to call programs Perform a stored procedure call with input, output parms DB2/400 can create external stored procs for RPG, CL pgms Windows install a DB and create stored procs Sample stored proc (tested with MySQL): sql.execute """ CREATE PROCEDURE HouseSwap(_first1 VARCHAR(50), _first2 VARCHAR(50)) BEGIN DECLARE _loc1 INT; DECLARE _loc2 INT; SELECT loc_id into _loc1 FROM PERSON where fname = _first1; SELECT loc_id into _loc2 FROM PERSON where fname = _first2; UPDATE PERSON set loc_id = case fname when _first1 then _loc2 when _first2 then _loc1 end where (fname = _first1 OR fname = _first2); END """ Client call to proc above: def rowschanged = sql.call("{call HouseSwap('Guillaume', 'Paul')}")

Other program call options From Windows: Java toolkit ProgramCall class Pass input, output parameters Call RPG, CLP or? From System i: DB Stored proc that executes a local script or bat file Create and call a Windows Web service Start or stop a Windows service remotely using mmc Execute a.bat file on a file share Remotely invoke Groovy script that runs ActiveXObjects

4 Why use Groovy?

5 Is Groovy Java?

Convert Data as SQL Result set to XML import groovy.sql.sql; import groovy.xml.markupbuilder def req = """ SELECT id, name, givenname, unit FROM people""" def out = new File('out.xml') def writer = new FileWriter( out ) def xml = new MarkupBuilder( writer ) // create an xml doc, 1 agent per row with id and selected values xml.agents { sql.eachrow( req as String ) { row -> xml.agent(id:row.id) { name( row.name ) givenname( row.givenname ) unit( row.unit ) } } } Output is <agents> <agent id='870872'> <name>abti</name> <givenname>jean</givenname> <unit>sales</unit> </agent> </agents>

6 What free database can you install on Windows?

Send, receive files from Windows or System i Ftp from Microsoft's FTP client to IBM i FTP server Ftp from IBM i to IIS FTP or Apache FTP Server on Windows Standard FTP commands can be run manually or scripted Standard FTP session: ftp open myserver <user: myid <password: mypassword > help < lists all available commands // set binary transfer mode > bin > get myfile < file transfer completed > put thisfile < file transfer completed > disconnect > quit

3 What's the most flexible tool in our toolkit?

Talking Data Microsoft Speech API is built into the OS - Microsoft SAPI Groovy Scriptom can access ActiveXObject to run.net apps import org.codehaus.groovy.scriptom.* import static org.codehaus.groovy.scriptom.tlb.sapi.speechvoicespeakflags.* import static org.codehaus.groovy.scriptom.tlb.sapi.speechrunstate.* public class SpeakText { public static main(string[] args) { def voice = new ActiveXObject('SAPI.SpVoice') voice.speak("hi ${args[0]}, you're listening to Talking groovy ") sleep 500 voice.speak("thanks for calling") sleep 500 voice.speak("for " + datetoday() + ",, your account 1 2 3 4, in the Large Cap, MATTRESS fund gained 1.2%") sleep 500 voice.speak("let me know if you have any more questions. Thanks!") } } // Run the SpeakText.groovy class with Jim as the name groovy SpeakText.groovy "Jim"

7 How can you generate PDF files from a Word document?

Create pdf file from Excel You forgot to use Open-Office for your office applications? Convert Excel worksheet to pdf file using Groovy, PDFCreator def service = { args -> isok = false setparmsfrom(args) def infile = new File(inPath + infilename).canonicalpath Scriptom.inApartment { try { def excelapp = new ActiveXObject('Excel.Application') def workbooks = excelapp.workbooks def workbook = workbooks.open(infile) def worksheets = workbook.worksheets() def acount = worksheets.count() println "worksheets.count = " + acount def worksheet = worksheets.item(acount) worksheet.printout() println "worksheet name = " + worksheet.name() workbook.close(false, null, false) excelapp.quit() isok = true } catch(exception e) { println "Excel2pdf.groovy - error: " + e } } // end inapartment } Run the Excel2Pdf conversion qwx.win.excel.excel2pdf.main(args)}

8 How can you link Excel sales budget with DB2/400 sales?

Send emails from Windows Assumes you have an smtp mail server running locally on Windows. Use Apache SMTP framework from www.apache.org import org.apache.commons.net.smtp.* org = 'ebt-now.com' client = new SMTPClient() client.connect('localhost', 1025) client.login() client.sender = 'jemason@ebt-now.com' client.addrecipient('jemason1@yahoo.com') header = new SimpleSMTPHeader('jemason@ebt-now.com', 'jemason1@yahoo.com', 'subject- groovy email test') header.addheaderfield('organization', org) writer = new PrintWriter(client.sendMessageData()) writer << header writer << the email test was successful on ${new Date()} writer.close() client.logout() client.disconnect()

Windows remote access Multiple ways to remotely access a Windows server as a user Remote Desktop access Terminal Services Start Terminal Services first from the client: run mstsc Remote Telnet Telnet service Start Telnet server first from the client: run telnet to-server File shares Create a Windows file share first from the client: run \\myserver\myshare System i Access for Windows PC5250 client

Web services access Web service can run on System i or Windows server System i service calling RPG can use DB proc or PGM call class Web service on Windows can call.bat or ActiveXObject GroovyWs framework lets POJO (Java bean) run as a Web service Any normal Java bean is turned into a Web service (below) class MathService { double add(double arg0, double arg1) { return (arg0 + arg1) } double square(double arg0) { return (arg0 * arg0) } } Create a Web service server and publish the service for the bean above import groovyx.net.ws.wsserver def server = new WSServer() server.setnode("mathservice", "http://localhost:6980/mathservice") server.start()

Test, run a Web service Test the service simply by putting this in your browser: "http://localhost:6980/mathservice?wsdl" Call the Web service import groovyx.net.ws.wsclient def proxy = new WSClient("http://localhost:6980/MathService?wsdl", this.class.classloader) proxy.initialize() // from 0.5.0 def result = proxy.add(1.0 as double, 2.0 as double) assert (result == 3.0) result = proxy.square(3.0 as double) assert (result == 9.0)

Next steps Assess your opportunities and solutions Get help where you need it Check the references for more info... Groovy http://groovy.codehaus.org Grails www.grails.org Apache www.apache.org for Apache Ftp Server, Tomcat, Derby, Commons, IBM i site http://www-03.ibm.com/systems/i/?cm_re=masthead-_-products-_-sysiseries IBM i Java toolkit http://www-03.ibm.com/systems/i/software/toolbox/downloads.html IBM i Client Access for Windows documentation http://publib.boulder.ibm.com/infocenter/iseries/v7r1m0/index.jsp? topic=/rzahh/page1.htm