100% found this document useful (2 votes)
15 views

PDF Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley download

Examples

Uploaded by

himarazoumi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
15 views

PDF Foundation Db2 and Python: Access Db2 with Module-Based API Examples Using Python 1st Edition W. David Ashley download

Examples

Uploaded by

himarazoumi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Get ebook downloads in full at ebookmeta.

com

Foundation Db2 and Python: Access Db2 with Module-


Based API Examples Using Python 1st Edition W.
David Ashley

https://ebookmeta.com/product/foundation-db2-and-python-
access-db2-with-module-based-api-examples-using-python-1st-
edition-w-david-ashley/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Foundation Db2 and Python: Access Db2 with Module-Based


API Examples Using Python 1st Edition W. David Ashley

https://ebookmeta.com/product/foundation-db2-and-python-access-
db2-with-module-based-api-examples-using-python-1st-edition-w-david-
ashley-2/
ebookmeta.com

Practical Explainable AI Using Python: Artificial


Intelligence Model Explanations Using Python-based
Libraries, Extensions, and Frameworks Pradeepta Mishra
https://ebookmeta.com/product/practical-explainable-ai-using-python-
artificial-intelligence-model-explanations-using-python-based-
libraries-extensions-and-frameworks-pradeepta-mishra/
ebookmeta.com

Learn OpenCV with Python by Examples 2nd Edition James


Chen

https://ebookmeta.com/product/learn-opencv-with-python-by-
examples-2nd-edition-james-chen/

ebookmeta.com

Pocket Handbook of GI Pharmacotherapeutics 3rd Edition


Marianna G Mavilia George Y Wu

https://ebookmeta.com/product/pocket-handbook-of-gi-
pharmacotherapeutics-3rd-edition-marianna-g-mavilia-george-y-wu/

ebookmeta.com
Training a Wife 1st Edition Trinity Blacio

https://ebookmeta.com/product/training-a-wife-1st-edition-trinity-
blacio/

ebookmeta.com

Physics Text Book Part 1 for Class 12 12089 Ncert (Author)

https://ebookmeta.com/product/physics-text-book-part-1-for-
class-12-12089-ncert-author/

ebookmeta.com

The Business of Emotions in Modern History 1st Edition


Mandy L. Cooper

https://ebookmeta.com/product/the-business-of-emotions-in-modern-
history-1st-edition-mandy-l-cooper/

ebookmeta.com

Web Development and Design Foundations with HTML5, 10/e


10th Edition Terry Felke-Morris

https://ebookmeta.com/product/web-development-and-design-foundations-
with-html5-10-e-10th-edition-terry-felke-morris/

ebookmeta.com

A companion to medical anthropology Second Edition César


Abadía Barrero Editor Merrill Singer Editor Pamela Irene
Erickson Editor
https://ebookmeta.com/product/a-companion-to-medical-anthropology-
second-edition-cesar-abadia-barrero-editor-merrill-singer-editor-
pamela-irene-erickson-editor/
ebookmeta.com
Euphrates River Valley Settlement The Carchemish Sector in
the Third Millennium BC Edgar Peltenberg

https://ebookmeta.com/product/euphrates-river-valley-settlement-the-
carchemish-sector-in-the-third-millennium-bc-edgar-peltenberg/

ebookmeta.com
Foundation
Db2 and Python
Access Db2 with Module-Based API
Examples Using Python

W. David Ashley
Foundation Db2
and Python
Access Db2 with Module-Based API
Examples Using Python

W. David Ashley
Foundation Db2 and Python
W. David Ashley
Austin, TX, USA

ISBN-13 (pbk): 978-1-4842-6941-1 ISBN-13 (electronic): 978-1-4842-6942-8


https://doi.org/10.1007/978-1-4842-6942-8

Copyright © 2021 by W. David Ashley


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Celestin Suresh John
Development Editor: James Markham
Coordinating Editor: Divya Modi
Cover designed by eStudioCalamar
Cover image designed by Pixabay
Distributed to the book trade worldwide by Springer Science+Business Media New York, 1 New York Plaza,
Suite 4600, New York, NY 10004-1562, USA. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail orders-ny@
springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc
is a Delaware corporation.
For information on translations, please e-mail booktranslations@springernature.com; for reprint,
paperback, or audio rights, please e-mail bookpermissions@springernature.com.
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at http://www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/978-­1-­4842-­6941-­1. For more
detailed information, please visit http://www.apress.com/source-­code.
Printed on acid-free paper
This book is dedicated to teachers everywhere, but especially
all those who had me as a student.
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv

Chapter 1: Introduction to Db2��������������������������������������������������������������������������������� 1


What Is a Relational Database?���������������������������������������������������������������������������������������������������� 3
The Relational Model��������������������������������������������������������������������������������������������������������������� 3
Domains���������������������������������������������������������������������������������������������������������������������������������� 4
Keys and Indexes��������������������������������������������������������������������������������������������������������������������� 4
Relationships��������������������������������������������������������������������������������������������������������������������������� 4
Transactions���������������������������������������������������������������������������������������������������������������������������� 5
Stored Procedures������������������������������������������������������������������������������������������������������������������� 5
Constraints������������������������������������������������������������������������������������������������������������������������������ 6
Normalization�������������������������������������������������������������������������������������������������������������������������� 6
SQL������������������������������������������������������������������������������������������������������������������������������������������������ 6
Data Definition Language (DDL)����������������������������������������������������������������������������������������������� 7
Data Query Language (DQL)���������������������������������������������������������������������������������������������������� 7
Data Control Language (DCL)��������������������������������������������������������������������������������������������������� 7
Data Manipulation Language (DML)���������������������������������������������������������������������������������������� 7
The ibm_db Project����������������������������������������������������������������������������������������������������������������������� 8
Summary�������������������������������������������������������������������������������������������������������������������������������������� 8

Chapter 2: Installing Db2������������������������������������������������������������������������������������������ 9


My Development Environment������������������������������������������������������������������������������������������������������ 9
Installation Prerequisites������������������������������������������������������������������������������������������������������������ 10
Planning the Db2 Install�������������������������������������������������������������������������������������������������������������� 11
Installing Db2������������������������������������������������������������������������������������������������������������������������������ 12

v
Table of Contents

Db2 Post-install Tasks����������������������������������������������������������������������������������������������������������������� 19


Installing the Db2 Sample Database������������������������������������������������������������������������������������������� 20
Summary������������������������������������������������������������������������������������������������������������������������������������ 21

Chapter 3: Db2 Management���������������������������������������������������������������������������������� 23


Db2 Instances����������������������������������������������������������������������������������������������������������������������������� 23
db2ilist����������������������������������������������������������������������������������������������������������������������������������� 25
Instance Environment Commands����������������������������������������������������������������������������������������� 25
Creating an Instance������������������������������������������������������������������������������������������������������������� 26
Arranging a Communication Port and Host for an Instance�������������������������������������������������� 26
Updating an Instance������������������������������������������������������������������������������������������������������������� 27
Upgrading an Instance���������������������������������������������������������������������������������������������������������� 28
Dropping an Instance������������������������������������������������������������������������������������������������������������ 29
Using Other Commands with an Instance����������������������������������������������������������������������������� 29
Databases����������������������������������������������������������������������������������������������������������������������������������� 30
Db2 Catalog Views����������������������������������������������������������������������������������������������������������������� 31
Locking Event Monitor����������������������������������������������������������������������������������������������������������� 31
Tablespace Information��������������������������������������������������������������������������������������������������������� 32
Storage Group Control Files��������������������������������������������������������������������������������������������������� 33
Global Configuration File������������������������������������������������������������������������������������������������������� 33
History Files��������������������������������������������������������������������������������������������������������������������������� 33
Logging Files������������������������������������������������������������������������������������������������������������������������� 33
Automated Storage Containers���������������������������������������������������������������������������������������������� 33
Creating a Database�������������������������������������������������������������������������������������������������������������� 34
Listing Databases������������������������������������������������������������������������������������������������������������������ 35
Activating a Database������������������������������������������������������������������������������������������������������������ 36
Deactivating a Database�������������������������������������������������������������������������������������������������������� 36
Connecting to a Database����������������������������������������������������������������������������������������������������� 36
Dropping a Database������������������������������������������������������������������������������������������������������������� 36
Tables������������������������������������������������������������������������������������������������������������������������������������������ 37
Table Types���������������������������������������������������������������������������������������������������������������������������� 39
Built-in Data Types���������������������������������������������������������������������������������������������������������������� 39

vi
Table of Contents

Creating a Table��������������������������������������������������������������������������������������������������������������������� 41
Alter a Table��������������������������������������������������������������������������������������������������������������������������� 43
Other Table SQL Statements�������������������������������������������������������������������������������������������������� 43
Dropping a Table�������������������������������������������������������������������������������������������������������������������� 44
Summary������������������������������������������������������������������������������������������������������������������������������������ 44

Chapter 4: Database Physical Design��������������������������������������������������������������������� 45


Phase 1: Data Gathering and Normalization������������������������������������������������������������������������������� 46
Data Gathering����������������������������������������������������������������������������������������������������������������������� 46
Data Normalization���������������������������������������������������������������������������������������������������������������� 48
Business Rules���������������������������������������������������������������������������������������������������������������������� 51
Phase 2: Physical Design of the Database���������������������������������������������������������������������������������� 51
Backups��������������������������������������������������������������������������������������������������������������������������������� 52
Summary������������������������������������������������������������������������������������������������������������������������������������ 53

Chapter 5: Db2 Utilities������������������������������������������������������������������������������������������� 55


Backup Command����������������������������������������������������������������������������������������������������������������������� 56
What Is a Backup?����������������������������������������������������������������������������������������������������������������� 56
Backup Verification���������������������������������������������������������������������������������������������������������������� 57
Advanced Backup Options����������������������������������������������������������������������������������������������������� 57
Backup Syntax����������������������������������������������������������������������������������������������������������������������� 57
Export Command������������������������������������������������������������������������������������������������������������������������� 59
Command syntax������������������������������������������������������������������������������������������������������������������� 60
Usage Notes�������������������������������������������������������������������������������������������������������������������������� 60
Import Command������������������������������������������������������������������������������������������������������������������������ 61
Command Syntax������������������������������������������������������������������������������������������������������������������ 61
Load Command��������������������������������������������������������������������������������������������������������������������������� 62
Command Syntax������������������������������������������������������������������������������������������������������������������ 62
Restore Command���������������������������������������������������������������������������������������������������������������������� 63
Command Syntax������������������������������������������������������������������������������������������������������������������ 64
Summary������������������������������������������������������������������������������������������������������������������������������������ 65

vii
Table of Contents

Chapter 6: Business Rules and Constraints������������������������������������������������������������ 67


NOT NULL Attribute��������������������������������������������������������������������������������������������������������������������� 67
Primary Key��������������������������������������������������������������������������������������������������������������������������������� 68
Indexes���������������������������������������������������������������������������������������������������������������������������������������� 69
Foreign Keys������������������������������������������������������������������������������������������������������������������������������� 70
CHECK and Unique Constraints��������������������������������������������������������������������������������������������������� 71
DEFAULT Constraint��������������������������������������������������������������������������������������������������������������������� 72
Triggers��������������������������������������������������������������������������������������������������������������������������������������� 72
Summary������������������������������������������������������������������������������������������������������������������������������������ 76

Chapter 7: Writing Good SQL for Db2���������������������������������������������������������������������� 77


Relational Theory������������������������������������������������������������������������������������������������������������������������ 77
Reduce Passes Through Data����������������������������������������������������������������������������������������������������� 78
Using Indexes to Increase Performance������������������������������������������������������������������������������������� 81
Sorting and Grouping������������������������������������������������������������������������������������������������������������������ 81
Programs Containing SQL����������������������������������������������������������������������������������������������������������� 82
Use Db2 Utilities Where Possible������������������������������������������������������������������������������������������������ 83
Db2 Functions����������������������������������������������������������������������������������������������������������������������������� 84
Multiple Ways to Code SQL��������������������������������������������������������������������������������������������������������� 86
Summary������������������������������������������������������������������������������������������������������������������������������������ 86

Chapter 8: Python and ibm_db������������������������������������������������������������������������������� 87


Your First Python ibm_db Program��������������������������������������������������������������������������������������������� 89
Using Parameter Markers������������������������������������������������������������������������������������������������������ 96
More on Parameter Markers�������������������������������������������������������������������������������������������������� 98
Producing Multiple Reports with Parameter Markers��������������������������������������������������������� 100
Using Parameter Markers Without Binding Variables���������������������������������������������������������� 103
Joining Tables���������������������������������������������������������������������������������������������������������������������� 106
Inserts, Updates, and Deletes���������������������������������������������������������������������������������������������� 109
Some Other ibm_db APIs����������������������������������������������������������������������������������������������������� 112
Creating Database Objects�������������������������������������������������������������������������������������������������� 116

viii
Table of Contents

Obtaining Attributes of an Existing Table����������������������������������������������������������������������������� 120


Obtaining Attributes of a Result Set������������������������������������������������������������������������������������ 126
ibm_db_dbi and Python������������������������������������������������������������������������������������������������������������ 130
Where Is the ibm_db Module Going?���������������������������������������������������������������������������������������� 133
The ibm_db_dbi Module������������������������������������������������������������������������������������������������������ 134
The Django Database Interface������������������������������������������������������������������������������������������� 134
The SQLAlchemy Adapter���������������������������������������������������������������������������������������������������� 135
The Alembic Adapter����������������������������������������������������������������������������������������������������������� 136
The Future��������������������������������������������������������������������������������������������������������������������������� 137
Summary���������������������������������������������������������������������������������������������������������������������������������� 137

Appendix A: Python ibm_db API��������������������������������������������������������������������������� 139


i bm_db APIs������������������������������������������������������������������������������������������������������������������������������ 139
ibm_db.active���������������������������������������������������������������������������������������������������������������������� 139
ibm_db.autocommit������������������������������������������������������������������������������������������������������������ 140
ibm_db.bind_param������������������������������������������������������������������������������������������������������������ 141
ibm_db.callproc������������������������������������������������������������������������������������������������������������������� 143
ibm_db.client_info��������������������������������������������������������������������������������������������������������������� 144
ibm_db.close����������������������������������������������������������������������������������������������������������������������� 146
ibm_db.column_privileges�������������������������������������������������������������������������������������������������� 147
ibm_db.columns������������������������������������������������������������������������������������������������������������������ 148
ibm_db.commit������������������������������������������������������������������������������������������������������������������� 151
ibm_db.conn_error�������������������������������������������������������������������������������������������������������������� 152
ibm_db.conn_errormsg������������������������������������������������������������������������������������������������������� 153
ibm_db.connect������������������������������������������������������������������������������������������������������������������� 154
ibm_db.createdb����������������������������������������������������������������������������������������������������������������� 157
ibm_db.createdbNX������������������������������������������������������������������������������������������������������������� 158
ibm_db.cursor_type������������������������������������������������������������������������������������������������������������ 159
ibm_db.dropdb�������������������������������������������������������������������������������������������������������������������� 160
ibm_db.exec_immediate����������������������������������������������������������������������������������������������������� 160
ibm_db.execute������������������������������������������������������������������������������������������������������������������� 162

ix
Table of Contents

ibm_db.execute_many�������������������������������������������������������������������������������������������������������� 163
ibm_db.fetch_tuple������������������������������������������������������������������������������������������������������������� 165
ibm_db.fetch_assoc������������������������������������������������������������������������������������������������������������ 166
ibm_db.fetch_both�������������������������������������������������������������������������������������������������������������� 167
ibm_db.fetch_row��������������������������������������������������������������������������������������������������������������� 168
ibm_db.field_display_size��������������������������������������������������������������������������������������������������� 169
ibm_db.field_name������������������������������������������������������������������������������������������������������������� 169
ibm_db.field_num��������������������������������������������������������������������������������������������������������������� 170
ibm_db.field_precision�������������������������������������������������������������������������������������������������������� 172
ibm_db.field_scale�������������������������������������������������������������������������������������������������������������� 173
ibm_db.field_type���������������������������������������������������������������������������������������������������������������� 174
ibm_db.field_width������������������������������������������������������������������������������������������������������������� 174
ibm_db.foreign_keys����������������������������������������������������������������������������������������������������������� 175
ibm_db.free_result�������������������������������������������������������������������������������������������������������������� 178
ibm_db.free_stmt���������������������������������������������������������������������������������������������������������������� 179
ibm_db.get_option�������������������������������������������������������������������������������������������������������������� 179
ibm_db.next_result������������������������������������������������������������������������������������������������������������� 181
ibm_db.num_fields�������������������������������������������������������������������������������������������������������������� 183
ibm_db.num_rows�������������������������������������������������������������������������������������������������������������� 184
ibm_db.pconnect����������������������������������������������������������������������������������������������������������������� 185
ibm_db.prepare������������������������������������������������������������������������������������������������������������������� 187
ibm_db.primary_keys���������������������������������������������������������������������������������������������������������� 188
ibm_db.procedure_columns������������������������������������������������������������������������������������������������ 190
ibm_db.procedures������������������������������������������������������������������������������������������������������������� 192
ibm_db.recreatedb�������������������������������������������������������������������������������������������������������������� 194
ibm_db.result���������������������������������������������������������������������������������������������������������������������� 194
ibm_db.rollback������������������������������������������������������������������������������������������������������������������� 195
bm_db.server_info�������������������������������������������������������������������������������������������������������������� 196
ibm_db.set_option��������������������������������������������������������������������������������������������������������������� 199
ibm_db.special_columns���������������������������������������������������������������������������������������������������� 201

x
Table of Contents

ibm_db.statistics����������������������������������������������������������������������������������������������������������������� 203
ibm_db.stmt_error�������������������������������������������������������������������������������������������������������������� 206
ibm_db.stmt_errormsg������������������������������������������������������������������������������������������������������� 206
ibm_db.table_privileges������������������������������������������������������������������������������������������������������ 207
ibm_db.tables���������������������������������������������������������������������������������������������������������������������� 209
Summary���������������������������������������������������������������������������������������������������������������������������������� 210

Index��������������������������������������������������������������������������������������������������������������������� 211

xi
About the Author
W. David Ashley is a technical writer for Skillsoft where he
specializes in open source, particularly Linux. As a member
of the Linux Fedora documentation team, he recently led
the Libvirt project documentation and wrote the Python
programs included with it. He has developed in 20 different
programming languages during his 30 years as a software
developer and IT consultant, including more than 18 years at
IBM and 12 years with American Airlines.

xiii
About the Technical Reviewer
Sourav Bhattacharjee is a senior technical member for
Oracle Cloud Infrastructure. As part of IBM Watson Health
Lab, he has developed many scalable systems, published a
few research papers, and applied some patents to USPTO. He
has an ample amount of hands-on experience in Python,
Java, machine learning, and many database systems. He
earned his master’s degree from the Indian Institute of
Technology, Kharagpur, India.

xv
CHAPTER 1

Introduction to Db2
Welcome to this introduction to Db2. Since you are here, you are likely looking for a
place to get started with Db2. Our hope is that this book will be that first step you are
looking for. This book is meant to be an introduction to the Db2 environment and to
the Python interface. The first half of the book will cover Db2 at a level that should be of
interest to both administrators and programmers. It will cover many aspects of Db2 that
you will make use of in either of the two roles. The last half of the book will concentrate
on using the Python programming language to interface to Db2. While mainly oriented
to programmers, administrators will find it useful as well for some of their everyday
tasks.
Db2 has a long history and is the first relational database implementation. It was
first proposed by Edgar Frank “Ted” Codd in a paper titled “A Relational Model of Data
for Large Shared Data Banks” in 1969 while working at the IBM’s San Jose Research
Laboratory in California. In the next four years, IBM researchers worked to create a
system based on the principles described in Codd’s paper (called System R). During
this time, it became obvious that a new language was needed to interact with the new
system. Codd wrote a new paper “A Data Base Sublanguage Founded on Relational
Calculus,” which became the basis for the new language called DSL/Alpha. This quickly
went through some name changes but eventually ended up being called SQL, short for
Structured Query Language.
Eventually there was an effort in the 1970s to port DSL/Alpha to the 370 mainframe
environment. It was renamed to Database 2 in 1982. The next year it was made available
to the public with another name change, DB2. This was a limited release but was highly
regarded by the customers that evaluated it. The customers actually pushed IBM to
deliver DB2 to a wider set of customers. IBM was somewhat reluctant because they were
trying to hold on to their IMS/DB market share. But eventually the customers won out,
and DB2 began to spread to other platforms including OS/2, AIX/RS6000, and Windows.

1
© W. David Ashley 2021
W. D. Ashley, Foundation Db2 and Python, https://doi.org/10.1007/978-1-4842-6942-8_1
Chapter 1 Introduction to Db2

Over the next two decades, the product went through a number of name changes
and several platform code bases. Recently with the release of version 11.1, IBM
rebranded the entire product line and brought the code bases into a small number of
code bases. The following set of products are now the standard offerings:

• Db2 (formerly DB2 LUW)

• Db2 for z/OS (formerly DB2 for z/OS)

• Db2 Hosted (formerly DB2 on Cloud)

• Db2 on Cloud (formerly dashDB for Transactions)

• Db2 Event Store (a new in-memory database for event-driven


transaction processing)

• Db2 Warehouse on Cloud (formerly dashDB)

• Db2 Warehouse (formerly dashDB Local)

• IBM Integrated Analytics System (a new system platform that


combines analytic performance and functionality of the IBM
PureData System with IBM Netezza)

The code bases for today’s Db2 offerings share a common code base that makes
porting the code to another hardware/software platform a relatively easy process. The
SQL code base has been standardized so that it is the same across all platforms, making
moving to another platform an easy task from a programming perspective.
There is also a current movement in programming applications with embedded
SQL. These types of applications are very hard to port from one platform to another
without major code modifications. Instead, IBM is moving (where possible) to an API
that can be called to process SQL statements and make use of programming language
variables for values to be added to the SQL statement. This is the methodology used for
Python that we will explore later in this book.
In the past, Db2 was considered to be too large for most applications. But as personal
computers have become a lot more powerful and then databases used by even a small
number of people have become extremely large, Db2 has become more attractive in the
management of this data. Also, the pricing model of Db2 on these platforms has become
more competitive. So if you need the performance and the ability to manage large
amounts of data, Db2 can be a very attractive product.

2
Other documents randomly have
different content
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.

You might also like