Presentation is loading. Please wait.

Presentation is loading. Please wait.

IBM Software Group | Rational Software © 2007 IBM Corporation Access to System i and System z data Mark Evans

Similar presentations


Presentation on theme: "IBM Software Group | Rational Software © 2007 IBM Corporation Access to System i and System z data Mark Evans"— Presentation transcript:

1 IBM Software Group | Rational Software © 2007 IBM Corporation Access to System i and System z data Mark Evans evansm@us.ibm.com

2 IBM Software Group | Rational Software © 2003 IBM Corporation 2 –© Copyright IBM Corporation 2007. All rights reserved. –The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates. –This information is based on current IBM product plans and strategy, which are subject to change by IBM without notice. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way. –IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and other IBM Rational products and services are trademarks or registered trademarks of the International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.

3 IBM Software Group | Rational Software © 2003 IBM Corporation 3 Agenda – Access to Mainframe Data  What’s Possible?  SQL Access –How to do it? –Configuration Possibilities –Specifying Connection Information –Specifying Jar File Locations –Miscellaneous  Access to Files –Remote –From Generated COBOL programs  Lab accessing remote DB2 on z/OS

4 IBM Software Group | Rational Software © 2003 IBM Corporation 4 Data Access from EGL – local on System z  From Generated COBOL –Serial –Indexed, relative keys (VSAM) –DB2 –DL/I –MQ Queues –CICS Transient Data Queues Temporary Storage Queues Spool –IMS GSAM files

5 IBM Software Group | Rational Software © 2003 IBM Corporation 5 Data Access from EGL – local on System i  From Generated COBOL –File Access Serial Indexed Relative Record –DB2 –MQ Queues Note: Data Queues are accessible only through called CL programs, not direct.

6 IBM Software Group | Rational Software © 2003 IBM Corporation 6 Remote Access from EGL – SQL – Controlling Access  Database - DB2,Oracle, etc Requires JDBC driver and access to jar/zip file containing the class >Example: com.ibm.db2.jcc.DB2Driver Connection to database defined via Connection URL > Example: jdbc:db2://localhost:50000/SAMPLE EGL does not know or care that it is connecting to a remote database (System i or System z) It just connects to a URL (non-J2EE) or JNDI name (J2EE)  “Remote Access” -- means from debugger and from WAS deployed apps

7 IBM Software Group | Rational Software © 2003 IBM Corporation 7 Remote Access from EGL – DB2 on z/OS  Access done through DB2 supplied JDBC Drivers –Choice of two drivers: DB2 Universal JDBC Driver DB2 App Driver  Choosing the Universal Driver vs. the App Driver –DB2 Universal JDBC Driver (recommended): +Most Modern Driver from DB2 +No infrastructure to setup +Supports Scrollable cursors from EGL +Will be pre-requisite for other EGL functionality in future -Cannot control DATE/TIMESTAMP format when EGL variable defined as CHAR -Always returned/expected in ISO format –DB2 App Driver +Allows control of DATE/TIMESTAMP format when EGL variable defined as CHAR -More infrastructure setup required -To be deprecated in future

8 IBM Software Group | Rational Software © 2003 IBM Corporation 8 Remote Access from EGL – DB2 on z/OS  What’s required to make this work (Universal Driver)? –IBM Universal JDBC Driver + Valid DB2 Connect License Jar DB2 V8.1 or later No testing done with V9 yet Just supply access information in URL Reference Doc: DB2Unicon.doc DB2 Host NameDB2 Host PortDB2 Location Jar file for Universal DriverLicense Jar file for Remote z/OS connection

9 IBM Software Group | Rational Software © 2003 IBM Corporation 9 Remote Access from EGL – DB2 on z/OS  What’s required to make this work (App Driver)? –IBM App Driver + Valid DB2 Connect Installed (full product somewhere + Client access) DB2 V8.1 or later AND DB2 Connect V8.1 or later No testing done with V9 yet Database and remote nodes must be defined in DB2 catalogs DB2 Catalog Definition for remote Database Zip File containing App Driver

10 IBM Software Group | Rational Software © 2003 IBM Corporation 10 Remote Access from EGL – DB2 on z/OS  Miscellaneous Topics –Allows user to Specify a Secondary Authentication ID to “set Current SQLID” to specify schema on unqualified table names in record definitions –Setting date/timestamp format for DB2 App driver (if needed) Requires at least DB2 V8.1 Fix pack 10/DB2 8.2 Fix pack 3) Open DB2 Command Window Run the following command: db2 update cli cfg for section COMMON using DateTimeStringFormat USA (or EUR/ISO/…) You can check the current configuration by running the following command: db2 get cli cfg

11 IBM Software Group | Rational Software © 2003 IBM Corporation 11 Remote Access from EGL – DB2 on System i  Remote access -- means from debugger and from WAS deployed apps  Access done through System i Java Toolkit supplied JDBC Driver Host Name of System i machine JT400 jar file containing AS400JDBCDriver class URL must specify as400

12 IBM Software Group | Rational Software © 2003 IBM Corporation 12 Getting the JT400 Toolkit for DB2 access – System i ? or  With WDSC, in the following directory – \rwdi_shared\eclipse\plugins\com.ibm.etools.iseries.toolbox_6.0.1\runtime or  From the System i directories –\QIBM\ProdData\HTTP\Public\j4400\lib

13 IBM Software Group | Rational Software © 2003 IBM Corporation 13 Specifying Connection Info to databases – Where do I do it? We covered the basics on what is needed to access remote DB2 databases Now let’s look at how you specify this remote access during development and when executing generated Java programs!!

14 IBM Software Group | Rational Software © 2003 IBM Corporation 14 Specifying Connection Info to databases – Where do I do it?  SQL Retrieve  SQL Statement Validation  EGL Debugger if not in debug build descriptor –Use EGL SQL Database Connection Preference

15 IBM Software Group | Rational Software © 2003 IBM Corporation 15 Specifying connection info to databases – Where do I do it?  EGL Data Parts Wizard –Connection information can be created in Wizard or –Through Database Explorer view in the Data Perspective It is the same wizard

16 IBM Software Group | Rational Software © 2003 IBM Corporation 16 Specifying Connection Info to databases – Where do I do it?  For Web Applications (J2EE) –JNDI Name in build descriptor –JNDI reference in web.xml –WAS Data source Definition with associated JNDI name See Lab for more details

17 IBM Software Group | Rational Software © 2003 IBM Corporation 17 Specifying Connection Info to databases – Where do I do it?  For non-J2EE Generated Java Apps and  Debug –In Build descriptor sqlDB –Connection URL sqlJDBCDriverClass –Class to use for connection –Which results in Rununit.properties Found in JavaSource folder

18 IBM Software Group | Rational Software © 2003 IBM Corporation 18 Adding Jar file to Classpath for JDBC Drivers – Where do I do it? Now let’s look at how you setup your projects/systems to find the jar files with the JDBC drivers “Avoid the dreaded “ClassNotFound” exception for the JDBC classes”

19 IBM Software Group | Rational Software © 2003 IBM Corporation 19 Adding Jar file to Classpath for JDBC Drivers – Where do I do it?  For J2EE Apps: –WAS JDBC Provider definition plus –WAS WebSphere Variables

20 IBM Software Group | Rational Software © 2003 IBM Corporation 20 Adding Jar file to Classpath for JDBC Drivers – Where do I do it?  For non-J2EE Generated Java Apps and  Debug (if not using EGL Preferences) –In Java Build Path of Project Properties NOTEs:  If you export and import project into another workspace, this hard coded location may fail.  On deployment, the DB2 jar files WILL NOT be exported with the resultant jar file. You will need to add to CLASSPATH

21 IBM Software Group | Rational Software © 2003 IBM Corporation 21 Adding Jar file to Classpath for JDBC Drivers – Where do I do it?  Debug (if using EGL Preferences) –Mainly used for customers who are only generating COBOL for deployed apps

22 IBM Software Group | Rational Software © 2003 IBM Corporation 22 Miscellaneous - SQL Retrieve Preferences for COBOL Gen record employee type SQLRecord {tableNames = [["DRBRUCE.EMPLOYEE"]]} 10 EMPNO char(6) {column="EMPNO", isNullable=yes}; 10 FIRSTNME char(12) {column="FIRSTNME", isNullable=yes; 10 MIDINIT char(1) {column="MIDINIT", isNullable=yes}; 10 LASTNAME char(15) {column="LASTNAME", isNullable=yes; 10 HIREDATE char(10) {column=“HIREDATE", isNullable=yes}; 10.. record employee type SQLRecord {tableNames = [["DRBRUCE.EMPLOYEE"]]} EMPNO string {column="EMPNO", isNullable=yes, maxLen=6}; FIRSTNME string {column="FIRSTNME", isNullable=yes, maxLen=12}; MIDINIT string {column="MIDINIT", isNullable=yes, maxLen=1}; LASTNAME string {column="LASTNAME", isNullable=yes, maxLen=15}; HIREDATE date {column=“HIREDATE", isNullable=yes}; VERSUS

23 IBM Software Group | Rational Software © 2003 IBM Corporation 23 Other Remote Data Access from EGL Debugger and Java Gen  Indexed, relative keys (VSAM) Uses EGL supplied Distributed File Manager support –VSAMWIN.zip in plug-in directories SNA (or TCP62) based –Requires SNA client product (like IBM Personal Communications) to supply protocol drivers Reference doc:WDz6RemoteVSAM.pdf –IMS/DB (alias DL/I) Not supported in V6

24 IBM Software Group | Rational Software © 2003 IBM Corporation 24 File Access from Generated COBOL  Controlling/Specifying Access –Files Logical file name is property of record definition Association to physical file name defined using EGL “resource association” –Another build file part –Also associates to runtime logical names such as: >JCL DD Names >CICS File Definition Entries

25 IBM Software Group | Rational Software © 2003 IBM Corporation 25 Build Parts – Resource Association  Is needed only for EGL record that accesses an external file, printer, or MQ  Has a logical file or queue name  Like JCL in a batch application if serial files Conceptual View of External File Access in EGL  See the topic in the tutorial: Conceptual View of External File Access in EGL  Allows different mappings depending on target platform

26 IBM Software Group | Rational Software © 2003 IBM Corporation 26 Build Parts – Resource Association - Relationships Record queuename property points to Association element in Resource Association Part Resource Association Part referenced from Build Descriptor Part Association element can be associated with multiple target platforms and file type combinations Each target platform and file type combination has its own properties Uses this Build Descriptor

27 IBM Software Group | Rational Software © 2003 IBM Corporation 27 Available Materials (Access to Remote Resources)  Documents on Developerworks –DB2Unicon.doc - database setup for DB2 on z/OS access –iSeriesTutorial.doc- includes database setup for DB2 on iSeries access  Materials from class: –Lab document –db2oniSeriesSetup.doc- database setup for DB2 on iSeries –WDz6RemoteVSAM.pdf- Remote VSAM access to z/OS from EGL debugger


Download ppt "IBM Software Group | Rational Software © 2007 IBM Corporation Access to System i and System z data Mark Evans"

Similar presentations


Ads by Google