Java Stored Procedures in DB2 for OS/390 Open, Portable Application Logic Julian Stuhler DB2/CICS/IMS GUIDE May 2000.

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1
Lecture plan Information retrieval (from week 11)
Active Directory: Final Solution to Enterprise System Integration
Embedded SQL John Ortiz. Lecture 15Embedded SQL2 Why Isn’t Interactive SQL Enough?  How to do this using interactive SQL?  Print a well-formatted transcript.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 13 Introduction to SQL Programming Techniques.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing.
Introduction to z/OS Basics © 2006 IBM Corporation Chapter 8: Designing and developing applications for z/OS.
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
DB2 Stored Procedures and UDFs: A Primer
Systems Software Operating Systems.
Performance and Capacity Experiences with Websphere on z/OS & OS/390 CMG Canada April 24, 2002.
SEMESTER 1, 2013/2014 DB2 APPLICATION DEVELOPMENT OVERVIEW.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 7: Designing and developing applications for z/OS.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
C Copyright © 2009, Oracle. All rights reserved. Using Diagnosis and Debugging Techniques.
INTRODUCTION TO WEB DATABASE PROGRAMMING
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Applets & Servlets.
September 6, 2015 Connecting Client Applications to Informix Databases using IBM Informix Connect and ODBC James Edmiston Database Consultant Quest Information.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
Benefits of PL/SQL. 2 home back first prev next last What Will I Learn? In this lesson, you will learn to: –List and explain the benefits of PL/SQL –List.
How to Configure Informix Connect and ODBC James Edmiston Informix DBA Consultant/Quest Information Systems, Inc. Informix User Forum 2005 Moving Forward.
Understanding the CORBA Model. What is CORBA?  The Common Object Request Broker Architecture (CORBA) allows distributed applications to interoperate.
Volvo Information Technology Dept Slide: 1 Volvo Information Technology UNIX OS/390 Win Java Enhancements in DB2 for z/OS and OS/390 version.
M1G Introduction to Database Development 6. Building Applications.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
1 Module Objective & Outline Module Objective: After completing this Module, you will be able to, appreciate java as a programming language, write java.
BLU-ICE and the Distributed Control System Constraints for Software Development Strategies Timothy M. McPhillips Stanford Synchrotron Radiation Laboratory.
© Blackboard, Inc. All rights reserved. Deploying a complex building block Andre Koehorst Learning Lab Universiteit Maastricht, the Netherlands July 18.
CHAPTER TEN AUTHORING.
Introduction to the new mainframe © Copyright IBM Corp., All rights reserved. Chapter 12 Understanding database managers on z/OS.
Database Architectures Database System Architectures Considerations – Data storage: Where do the data and DBMS reside? – Processing: Where.
F15 Philip K. Gunning, DGI Anaheim, CA Sept , 2002 Fundamentals of DB2 SQL Procedures.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Object-Oriented Program Development Using Java: A Class-Centered Approach, Enhanced Edition.
Chapter 5 Information Systems in Business Software
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CPS120: Introduction to Computer Science Compiling a C++ Program From The Command Line.
Development Overview Pertemuan 11 Matakuliah: T0413 Tahun: 2009.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
CS 440 Database Management Systems Stored procedures & OR mapping 1.
Copyright © 2016 Ramez Elmasri and Shamkant B. Navathe.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
A Presentation Presentation On JSP On JSP & Online Shopping Cart Online Shopping Cart.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Lecture 9: The Client/Server Database Environment Modern Database Management 9 th Edition.
Introduction To Software Development Environment.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Chapter Goals Describe the application development process and the role of methodologies, models, and tools Compare and contrast programming language generations.
Chapter 10 Application Development
Computer System Structures
Applications Active Web Documents Active Web Documents.
ODBC, OCCI and JDBC overview
Web Technologies IT230 Dr Mohamed Habib.
The Client/Server Database Environment
Key Ideas from day 1 slides
Lecture 1: Introduction to JAVA
Network Load Balancing
The Client/Server Database Environment
PHP / MySQL Introduction
Introduction of Week 3 Assignment Discussion
Ch > 28.4.
DB2.
Introduction CSC 111.
CMP 131 Introduction to Computer Programming
MATERI PL/SQL Procedures Functions Packages Database Triggers
Presentation transcript:

Java Stored Procedures in DB2 for OS/390 Open, Portable Application Logic Julian Stuhler DB2/CICS/IMS GUIDE May 2000

Topics  Introduction  Java Stored Procedures – An Overview  Environment Set-up  Developing & Testing JSPs  Usage Considerations  Summary

Introduction

 DB2 consultant with Triton Consulting, based in the UK  14 years DB2 experience Database Administration Systems Programming Application Development  IBM Gold Consultant  Redbook – DB2 Network Computing Enhancements & Java Stored Procedures

JSPs – An Overview

What’s a Stored Procedure?  A program or routine executed by the database server in response to an SQL CALL statement issued by a client  Can receive and return parameters from / to calling client  Can enhance performance by replacing multiple SQL client calls  Can promote code re-use and consistency  Can improve security

Supported Languages  Can be written in a wide variety of languages Cobol C/C++ Assembler PL/1 REXX * PSM * Java * * Needs additional APAR support for V5 and V6

Java Stored Procedures  Prerequisites OS/390 Unix System Services (USS) OS/390 Recoverable Resource Services (RRS) and Workload Manager (WLM) DB2 For OS/390 V5 or V6 (with necessary additional APARs) Enterprise Toolkit for OS/390 (part of VisualAge for Java)  Features Open and fully portable code High Performance Java support JDBC (dynamic) and SQLJ (static) support

High Performance Java  HPJ compiler (part of ET/390) compiles Java into standard OS/390 machine code  Advantages Very high performance Retain code portability Allows WLM-managed stored procedures address space to run Java SPs without JVM support  Disadvantages More complex program preparation process

Java Terminology  Class Equivalent to a module in traditional programming  Method Equivalent to an entry point in traditional programming  Package A collection of related Java classes, “packaged” as a single unit Not to be confused with a DB2 package!

Environment Overview OS/390 USS Source Code Links Serialised Profiles WLM Executing SP DBRM Library Load Library

Runtime Environment

Environment Set-Up

 Complex environment  Plenty of pre-requisites OS/390 DB2  Allow plenty of time to install all pre- requisites and get sample applications working  Good communications needed between DB2 and USS systems support staff

Set-Up Tasks - 1  Design library naming standards USS  High Performance Java (HPJ) libraries  SQLJ/JDBC libraries  Links directory  Serialised profiles directory OS/390  HPJ SQLJ load library  Application stored procedure load library  JAVAENV dataset  DBRM library

Set-Up Tasks - 2  Create.profile script Probably subsystem-specific  Set up new WLM environment for JSPs Needs RRS enabled  Create HPJ versions of JDBC/SQLJ drivers  Create JAVAENV dataset  Tailor SQLJ properties and cursor files, if necessary

Developing & Testing

Coding  Most standard Java constructs can be used  Special code needed for null handling E.g. to pass null input parameter from JDBC client to a stored procedure  Specific code to handle SQLJ iterators and result sets  Refer to SC , Application Programming Guide and Reference for Java

Program Prep - JDBC

Program Prep - SQLJ

Error Handling & Debugging  Include provision for passing back results from SP in return parameters Consider passing back meaningful message if problem encountered ( e.printStackTrace() )  As for other types of stored procedures, debugging can be a problem Output of Java println commands routed to JSPDEBUG in WLM SP JCL Stored Procedure Builder and ET/390 Debugger tool provide additional facilities

Usage Guidelines

Naming Issues  Source files One stored procedure (Java application class) per source file Source file named after DB2 SP name  Java package name One to one relationship with HPJ load module Use same name for PDS/E member name Group all related source files in single USS directory named after package  Many others to be considered Java class name, Java method, DB2 packages, JAR files, etc

DB2 Collections  Each SQLJ SP has 4 packages associated with it (one for each isolation level)  Collection containing these SPs must appear in package list for client issuing SP CALL  Use one collection for each Java package, with same name as the package  For JDBC, collection named in client’s package list must contain 4 generic JDBC packages Collection name must match Java package name

Case Sensitivity  Use upper case only for Java package names on S/390 Ditto for other environments if portability is important  JDBC or SQLJ Java client calling a stored procedure must code SP name in upper case  SQLJ stored procedure must refer to DB2 object names in upper case (else –204)

Packaging  Carefully consider number of SPs to group in a single Java package Large number will result in large HPJ load module for the package, which may need excessive WLM storage Small number will result in many DB2 collections to manage  Rules of thumb Group together small, frequently used SPs Keep larger SPs in their own Java package Package remainder along application lines

Portability  No code changes necessary to port JSP source files from one platform to another (e.g. Windows NT to OS/390)  Some changes may be required when porting client code Class.forName (name of driver to be loaded) Connection URL  Beware issues with ASCII/EBCDIC translation of Java curly brackets ({})

Performance  Significant overhead on first use of a given module Consider pre-staging critical modules and keeping them in storage Once in storage, performance on a par with other methods  Use different WLM application groups to correctly prioritise workload

Summary

 JSPs for DB2 for OS/390 provide an open, scaleable, high-performance way of encoding an application’s business logic  Tread carefully in the short term; Complex environment set-up New application development skills DB2 code base still maturing

Questions?

For more information… Triton Consulting The Royal 25 Bank Plain Norwich NR2 4SF United Kingdom Tel:+44 (0) Fax:+44 (0)