PacktLib: IBM DB2 9.7 Advanced Application Developer Cookbook

IBM DB2 9.7 Advanced Application Developer Cookbook

Credits

About the Authors

About the Reviewers

www.PacktPub.com

Preface

Application Development Enhancements in DB2 9.7

Introduction

Changing column names online using the ALTER TABLE operation

Using the CREATE OR REPLACE clause while creating objects

Using the ALTER TABLE operation in a single transaction

Using the CREATE WITH ERROR support

Using the soft invalidation and automatic revalidation support

Using the ALTER COLUMN SET DATA TYPE extended support

Using the new TRUNCATE statement

Using AUTONOMOUS transactions

Using implicit casting during application enablement

Using the DEFAULT values and NAMED arguments in procedures

DB2 Application Techniques

Introduction

Granting and revoking instance-level authorities

Granting and revoking database-level authorities

Granting and revoking object privileges

Implementing static SQL in DB2

Implementing dynamic SQL in DB2

Creating Declared Global Temporary Tables (DGTTs)

Using XML in a declared temporary table

Improving performance by creating indexes on a DGTT

Creating Created Global Temporary Tables (CGTT)

Using generated columns in tables

Creating a savepoint

Rolling back to a savepoint

Using savepoints in JDBC

Using savepoints in SQLJ

Creating a sequence object

Modifying a sequence object

Referencing a sequence object

General Application Design

Introduction

Improving concurrency by using a connection concentrator

Using trusted contexts for improved security

Using trusted connections in JDBC

Using trusted connections in PHP

Securing data by using DB2 encryption

Improving concurrency by using enhanced optimistic locking

Working with user-defined types (UDT)

Working with structured types

Procedures, Functions, Triggers, and Modules

Introduction

Creating a simple stored procedure

Using dynamic SQL in stored procedures

Working with result sets in stored procedures

Using ARRAY objects in stored procedures

Handling errors in stored procedures

Designing external stored procedures

Using PL/SQL exception handling in a procedure

Working with the message buffer in stored procedures

Planning and designing triggers

Using scalar user-defined functions

Writing external user-defined functions

Designing external table functions

Working with modules in DB2

Designing Java Applications

Introduction

Creating connection objects in JDBC applications

Creating connection objects in SQLJ applications

Manipulating XML Data in Java applications

Batch processing in JDBC applications

Batch processing in SQLJ applications

Working with scrollable result sets

Handling errors and warnings in JDBC applications

Developing Java applications for high availability

Using SSL in Java applications

DB2 9.7 Application Enablement

Introduction

First step towards enabling Oracle application to DB2 9.7

Using ROWNUM and DUAL in DB2 9.7

Using CUR_COMMIT concurrency control isolation level

Implementing hierarchical queries for recursion support

Using PL/SQL ANONYMOUS block statements

Handling RAISE_APPLICATION_ERROR in DB2 PL/SQL

Migrating Oracle database objects on to DB2 9.7

Porting multi-action triggers from Oracle to DB2 9.7

Advanced DB2 Application Features and Practices

Introduction

Working with OLAP functions

Using optimizer profiles

Using explain utilities

Using section explain information

Interpreting db2exfmt output

Application development in partitioned databases

Preparing and Monitoring Database Applications

Introduction

Preparing applications for execution

Rebinding existing packages

Customizing application behavior using registry variables

Monitoring application performance

Advanced Performance Tuning Tips

Introduction

Understanding predicates in SQL statements

Improving INSERT performance

Writing effective SQL statements