IBM Press DB2 Express-C, The Developer Handbook for XML PHP C C++ Java and .NET (2006).pdf

(4104 KB) Pobierz
Front cover
DB2 Express-C:
The Developer Handbook for
XML, PHP, C/C++, Java, and
.NET
Learn DB2 application development
with XML, PHP, C/C++, JAVA, and .NET
Understand DB2 supported
programming environments
Practical application
examples
Whei-Jen Chen
John Chun
Naomi Ngan
Rakesh Ranjan
Manoj K. Sardana
993041268.008.png 993041268.009.png 993041268.010.png 993041268.011.png 993041268.001.png 993041268.002.png 993041268.003.png
International Technical Support Organization
DB2 Express-C: The Developer Handbook for XML,
PHP, C/C++, Java, and .NET
August 2006
SG24-7301-00
993041268.004.png 993041268.005.png 993041268.006.png 993041268.007.png
Note: Before using this information and the product it supports, read the information in
“Notices” on page ix.
First Edition (August 2006)
This edition applies to DB2 Universal Database for Linux, UNIX, and Windows Version 9.
© Copyright International Business Machines Corporation August 2006. All rights reserved.
Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP
Schedule Contract with IBM Corp.
 
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii
Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Trademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
The team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Become a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Comments welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiv
Chapter 1. DB2 application development overview . . . . . . . . . . . . . . . . . . . 1
1.1 Application development with DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1.1 DB2 supported development environments . . . . . . . . . . . . . . . . . . . . 2
1.1.2 DB2 supported interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2 DB2 Express-C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.3 DB2 Developer Workbench . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Chapter 2. Application development with DB2 pureXML . . . . . . . . . . . . . 49
2.1 Web application: XML is the answer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.2 pureXML in DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.1 When to use DB2 pureXML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
2.2.2 Designing pureXML-based applications . . . . . . . . . . . . . . . . . . . . . . 53
2.2.3 DB2 hybrid query engine. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
2.2.4 pureXML storage overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
2.2.5 SQL support for XML data (INSERT, SELECT) . . . . . . . . . . . . . . . . 58
2.2.6 Schema support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
2.2.7 Annotated XML schema decomposition . . . . . . . . . . . . . . . . . . . . . . 65
2.2.8 XML query support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
2.2.9 Constructor function (publishing functions) . . . . . . . . . . . . . . . . . . . . 77
2.2.10 XML indexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
2.2.11 Application support (interfaces). . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.2.12 Utilities and XML support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.2.13 XML type support in stored procedures . . . . . . . . . . . . . . . . . . . . . 90
Chapter 3. Application development with PHP . . . . . . . . . . . . . . . . . . . . . . 93
3.1 Application environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
3.1.1 Zend Framework overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
3.1.2 Setting up Zend Framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
iii
© Copyright IBM Corp. August 2006. All rights reserved.
Zgłoś jeśli naruszono regulamin