0% found this document useful (0 votes)
14 views

Java Programming with Oracle JDBC 1st ed Edition Donald Bales - The ebook is ready for download to explore the complete content

The document promotes various eBooks available for download at ebookname.com, including titles on Java programming and Oracle JDBC. It highlights the importance of foundational knowledge in Oracle JDBC for developing robust applications and provides a detailed overview of the book's structure, intended audience, and key topics covered. Additionally, it emphasizes the author's experience and advocacy for Oracle technologies in the context of Java development.

Uploaded by

cawiraciodar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Java Programming with Oracle JDBC 1st ed Edition Donald Bales - The ebook is ready for download to explore the complete content

The document promotes various eBooks available for download at ebookname.com, including titles on Java programming and Oracle JDBC. It highlights the importance of foundational knowledge in Oracle JDBC for developing robust applications and provides a detailed overview of the book's structure, intended audience, and key topics covered. Additionally, it emphasizes the author's experience and advocacy for Oracle technologies in the context of Java development.

Uploaded by

cawiraciodar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 50

Endless Ebook, One Click Away – Start Downloading at ebookname.

com

Java Programming with Oracle JDBC 1st ed Edition


Donald Bales

https://ebookname.com/product/java-programming-with-oracle-
jdbc-1st-ed-edition-donald-bales/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookname.com


Click here to visit ebookname.com and download ebook now
Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Oracle and Java Development 1st ed Edition Bulusu


Lakshman

https://ebookname.com/product/oracle-and-java-development-1st-ed-
edition-bulusu-lakshman/

Oracle Database Programming using Java and Web Services


1st Edition Kuassi Mensah

https://ebookname.com/product/oracle-database-programming-using-
java-and-web-services-1st-edition-kuassi-mensah/

Beginning programming with Java for dummies 2nd ed


Edition Barry A Burd

https://ebookname.com/product/beginning-programming-with-java-
for-dummies-2nd-ed-edition-barry-a-burd/

Knowledge Management 1st Edition Elias M. Awad

https://ebookname.com/product/knowledge-management-1st-edition-
elias-m-awad/
The Hood Battalion Royal Naval Division Antwerp
Gallipol Leonard Sellars

https://ebookname.com/product/the-hood-battalion-royal-naval-
division-antwerp-gallipol-leonard-sellars/

Happily Never After 1st Edition Lynn Painter

https://ebookname.com/product/happily-never-after-1st-edition-
lynn-painter/

Transport and Coherent Structures in Wall Turbulence


1st Edition Sedat Tardu

https://ebookname.com/product/transport-and-coherent-structures-
in-wall-turbulence-1st-edition-sedat-tardu/

Encyclopedia of Drugs Alcohol and Addictive Behavior


2nd Edition Rosalyn Carson-Dewitt

https://ebookname.com/product/encyclopedia-of-drugs-alcohol-and-
addictive-behavior-2nd-edition-rosalyn-carson-dewitt/

Handbook of the Economics of International Migration


1st Edition Barry R. Chiswick And Paul W. Miller (Eds.)

https://ebookname.com/product/handbook-of-the-economics-of-
international-migration-1st-edition-barry-r-chiswick-and-paul-w-
miller-eds/
Mah■bh■rata 1st ed Edition Bowles

https://ebookname.com/product/mahabharata-1st-ed-edition-bowles/
Java Programming with Oracle JDBC
Donald Bales
Publisher: O'Reilly
First Edition January 2002
ISBN: 0-596-00088-x, 496 pages

By GiantDino

Learn how to leverage JDBC, a key Java technology used to access


relational data from Java programs, in an Oracle environment.
Author Donald Bales begins by teaching you the mysteries of
establishing database connections, and how to issue SQL queries
Copyright and get results back. You'll move on to advanced topics such as
Table of Contents streaming large objects, calling PL/SQL procedures, and working
with Oracle9i's object-oriented features, then finish with a look at
Index
transactions, concurrency management, and performance.
Full Description
About the Author
Reviews
Reader reviews
Errata

Java Programming with Oracle JDBC

Preface
Why I Wrote This Book
This Book's Intended Audience
Structure of This Book
Conventions Used in This Book
Software and Versions
Comments and Questions
Acknowledgments

I: Overview

Introduction to JDBC
1.1 The JDBC API
1.2 Clients
1.3 Using SQL

II: Connections

2. Application Database Connections


2.1 JDBC Drivers
2.2 Installation
2.3 Connecting to a Database
2.4 Handling Exceptions

3. Applet Database Connections


3.1 Oracle Drivers and JDK Versions
3.2 It's an Applet's Life
3.3 Packaging Your Applet
3.4 Getting Around the Sandbox
3.5 Establishing a Connection Through a Firewall
3.6 Guidelines for Choosing a Workaround

4. Servlet Database Connections


4.1 Oracle Driver Selection
4.2 Servlet Connection Strategies
4.3 Guidelines for Choosing a Connection Strategy

5. Internal Database Connections


5.1 Server-Side Driver Types
5.2 Using the Server-Side Internal Driver
5.3 Using the Server-Side Thin Driver
5.4 JServer Program Support

6. Oracle Advanced Security


6.1 Authentication
6.2 Data Encryption
6.3 Data Integrity
6.4 A Data Encryption and Integrity Example
6.5 Secure Sockets Layer

7. JNDI and Connection Pooling


7.1 DataSources
7.2 Oracle's Connection Cache

III: Relational SQL

8. A Relational SQL Example


8.1 Relational Database Analysis
8.2 Refining the Analysis
8.3 Relational Database Design

9. Statements
9.1 Creating a Statement Object
9.2 The execute( ) Method
9.3 The executeUpdate( ) Method
9.4 The executeQuery( ) Method
9.5 OracleStatement Implements Statement

10. Result Sets


10.1 Basic Cursor Positioning
10.2 Data Types
10.3 Accessor Methods
10.4 Scrollable, Updateable Result Sets
10.5 ResultSet Is an OracleResultSet

11. Prepared Statements


11.1 A Prepared Statement Versus a Statement
11.2 Formulating SQL Statements
11.3 Batching
11.4 PreparedStatement Is an OraclePreparedStatement

12. Streaming Data Types


12.1 BLOBs
12.2 CLOBs
12.3 BFILEs
12.4 LONG RAWs
12.5 LONGs

13. Callable Statements


13.1 Understanding Stored Procedures
13.2 Calling Stored Procedures
13.3 CallableStatement Is an OracleCallableStatement

IV: Object-Relational SQL

14. An Object-Relational SQL Example


14.1 From Relational Tables to Object Views
14.2 Object Tables

15. Weakly Typed Object SQL


15.1 Accessing Objects as Relational Tables
15.2 Structs
15.3 Arrays
15.4 Refs
15.5 Calling Object Methods
15.6 Putting It All Together
15.7 Oracle's Implementations

16. Strongly Typed Object SQL


16.1 JPublisher
16.2 The SQLData Interface
16.3 Oracle's CustomDatum Interface

V: Essentials

17. Transactions
17.1 Manual Transactions
17.2 Transaction Scope
17.3 Implicit Locking and Visibility
17.4 Isolation Levels
17.5 Distributed Transactions

18. Detection and Locking


18.1 Oracle's Locking Mechanisms
18.2 Detection
18.3 Data Integrity Solutions

19. Performance
19.1 A Testing Framework
19.2 Auto-Commit
19.3 SQL92 Token Parsing
19.4 Statement Versus PreparedStatement
19.5 Batching
19.6 Predefined SELECT Statements
19.7 CallableStatements
19.8 OCI Versus Thin Drivers

20. Troubleshooting
20.1 The "Gotchas"
20.2 Unsupported Features
20.3 Debugging
20.4 Net8 Tracing
20.5 Wait for the Cure

Colophon

Preface
Oracle is the write-once-run-anywhere database. Since the mid-1980s, Oracle has been available
on almost every operating system. With the release of Oracle RDBMS Version 6, you could
develop a database schema on your desktop knowing it could be implemented unchanged on
multiple large-scale platforms. With the release of Oracle7, stored procedures could be written
using PL/SQL, and once again, these could be ported to any supported operating system.
Oracle8 brought object orientation, and Oracle8i brought internal support for Java . These
releases represent 15-plus years of demonstrated commitment by Oracle Corporation to make
Oracle the write-once-run-anywhere database. But platform independence alone did not make
Oracle the dominant database in the marketplace. Other factors contributed as well:
Open-systems initiatives
Oracle grew up with Unix and therefore carries an open-systems attitude that has
fostered innovation and acute customer awareness.
Configurable resources
The Oracle RDBMS resources, such as filesystem and memory usage, are configurable
and manageable by the DBA. As a result, an Oracle database can be tuned for the task
at hand, whether that task is transaction processing, batch processing, or decision
support.
Leading technology
Oracle has consistently led the relational database industry technologically. From time to
time, competitors have temporarily leaped ahead of Oracle in a niche, but Oracle has
always retaken the lead.

You may have already guessed that I am an Oracle advocate. I have had 16 years of experience
with Oracle and its competitors, and this alone has taught me to respect the product. A more
telling story is how many developers who have worked with Oracle tell me all the things they miss
when they work with another product.

I got involved with Oracle accidentally. The company I was working for had acquired one of its
competitors, and I was sent to the West Coast to convert the reports from something called a
relational database to COBOL VSAM/ISAM programs on a minicomputer. The reason for the
conversion was the poor performance of the acquired company's reports. During the conversion, I
heard all the badmouthing going around at that time about relational technology. My thoughts at
the time were that, performance aside, relational technology greatly simplified decision-support
development. And, had the reports I was converting been done right, performance would not
have been an issue.

After that experience, I felt that eventually, relational database technology would dominate the
development market, so I decided to research the products available and pick the one that I
thought would emerge as the market leader. After several months of research, I decided on
Oracle, which at the time was just in Version 5. Since that time, I have been working with Oracle
and, from time to time, its competitors. Over the years, I have used COBOL, Pro*COBOL, C,
Windows SDK, Pro*C, OCI, C++, Smalltalk, Visual Basic, PowerBuilder, PL/SQL, and Java as
client development languages -- all to access an Oracle database. With my varied experience, I
still remember my first mistakes with Oracle -- performing that conversion was the very first.

I have learned more than anything else that the only reason a relational database performs poorly
is because we don't use it like a relational database. On that first project with Oracle, the previous
programmers were performing data processing the slow way: they opened cursors on different
tables and did fetches until they found a match between tables, essentially doing full table scans
and not using the database to perform the joins. There was really no reason to badmouth
relational technology back then, except for our own ignorance. Boy, I sure could have used a
good O'Reilly book on Oracle back when I did that conversion.

While Oracle was growing as the database product of choice, Sun Microsystems released Java in
the mid-1990s. Since that time, Java has gone from being considered an applet language, a
client-side language, a server-side language, an enterprise application language, and now, with
Oracle8i, an object-relational database language. That is so cool. Now we can leverage the
strength of relational technology and object orientation in our enterprise applications on both
client and server. But to leverage this technology to build enterprise applications, we need to
have a solid foundation. That is what this book is all about. Oracle Java DataBase Connectivity
(JDBC) is the foundation for all your Java/Oracle applications.

Why I Wrote This Book


I am a firm believer that good foundational knowledge is a must if you, as an application
developer, are going to write a robust application. Your knowledge of the fundamentals of the
technologies you're using makes or break not only any application you write, but your
programming career as well. I was extremely pleased to write a book about Oracle JDBC,
because it is the foundation for using Java with Oracle.

This is a book written by a programmer for programmers. I try to include enough detail to get the
novice up and running without boring the experienced programmer to death. My hope is that this
book will guide you through the process of making a connection and executing SQL statements
while maintaining database integrity and enabling you to use all the database technologies
offered by Oracle.

This Book's Intended Audience


This book covers a lot of material about Oracle's implementation of JDBC. It provides both the
beginner and the advanced Oracle or Java user with all the information needed to be successful.
However, a certain amount of basic knowledge about SQL, Java, and object orientation is a must.

I am often asked, "What's the best way for me to learn Oracle?" Wow! Now that's a loaded
question. To learn Oracle is a big task, because Oracle is a big product. But I always respond
with these suggestions:

• Go to http://technet.oracle.com/membership/ and sign up on the Oracle


Technology Network (OTN, or Technet) as a member. It doesn't cost you anything to
become a member, and you get access to all of the Oracle documentation online. You
also get access to the discussion forums, where others like yourself post questions when
they're having problems. And you can download the most recent Java drivers and other
software for free.

• Better yet, sign up for a technology track or two. Technology tracks cost $200 each. For
your $200, you get four updates a year on a CD of all the software for a track. For $400,
you can get either the NT Servers or Linux Servers tracks along with the NT
Development Tools track and have a complete setup for learning Oracle.

• Do some serious studying. Read the Oracle Concepts Manual. Then read Oracle: The
Complete Reference, by George Koch and Kevin Loney (Osborne McGraw-Hill). Follow
that with the Oracle Developer's Guide. Then finish your beginner's work by reading
Oracle PL/SQL Programming by Steven Feuerstein with Bill Pribyl (O'Reilly). O'Reilly has
several other books on Oracle that you will find helpful. Check them out at
http://oracle.oreilly.com/.

• If you have the funding, send yourself to all the Oracle developer classes and a couple of
DBA classes, too -- so you can keep your DBA honest. The DBA classes will also help
you when you try to create your own database in your "learning" environment.

Usually when I offer this advice, I get a response such as: "Gee, that sounds like a lot of work."
True, it is a lot of work, but I've been studying Oracle for 16 years and I still don't know all of it.
How else do you expect to make the big bucks?

As far as Java goes, reading Learning Java by Patrick Niemeyer and Jonathan Knudsen
(O'Reilly) is an excellent starting point. O'Reilly has an entire series of books on Java that take
each major area and cover it exhaustively -- for example, Database Programming with JDBC and
Java by George Reese (O'Reilly). George's book covers basics that are not database-specific
while pursuing a more abstract or advanced approach to examining the various ways you can
utilize programming models with JDBC. Check out all the Java series titles at
http://java.oreilly.com/.

If you're into electronic documentation, you can download a copy of the JDBC Java specification
from Sun Microsystems at http://java.sun.com/products/jdbc/. The standard JDBC API
Javadoc can be found in the doc directory of the JDK you install. If you want a complete JDBC
API Javadoc, you can download a copy of Oracle's JDBC Javadoc at the OTN web site.

Structure of This Book


This book attempts to be both a tutorial and a reference. It's divided into five parts and includes
20 chapters. The material builds upon itself as you go along. So if you skip ahead in any section,
be forewarned that you may have to backtrack. The book is packed with fully functional examples
that demonstrate each concept as it is discussed.
Part I
Introduction to JDBC introduces the JDBC API, defines the term client-server, and
uses that definition to identify four different clients that JDBC programmers may
encounter. These client definitions create a context for the material covered in Part II.
Part II
Chapters 2-7 cover topics related to establishing a connection. While most books cover
this material in a couple of pages, too many developers suffer with the nuances of
establishing a connection under the four different client types not to warrant a more in-
depth coverage of the material.
Part III
Chapters 8-13 cover topics related to the use of traditional relational SQL. They also
cover the use of large binary objects (LOBs) and batching.
Part IV
Chapters 14-16 cover topics related to the use of Oracle's object-relational SQL. You will
learn how to work with user-defined database types using JDBC.
Part V
Chapters 17-20 cover topics related to transaction management, data integrity, locking,
detection, and troubleshooting. While not strictly part of JDBC, these are essential topics
that every JDBC programmer should understand.

Conventions Used in This Book


The following typographical conventions are used in this book:
Italic
Used for filenames, directory names, table names, field names, and URLs. It is also used
for emphasis and for the first use of a technical term.
Constant width
Used for examples and to show the contents of files and the output of commands.
Constant width italic
Used in syntax descriptions to indicate user-defined items.
Constant width bold
Indicates user input in examples showing an interaction.
UPPERCASE
In syntax descriptions, usually indicates keywords.
lowercase
In syntax descriptions, usually indicates user-defined items such as variables.
[]
In syntax descriptions, square brackets enclose optional items.
{}
In syntax descriptions, curly brackets enclose a set of items from which you must choose
only one.
|
In syntax descriptions, a vertical bar separates the items enclosed in curly or square
brackets, as in {TRUE | FALSE}.
...
In syntax descriptions, ellipses indicate repeating elements.

Indicates a tip, suggestion, or general note.

Indicates a warning or caution.

Software and Versions


This book covers Oracle8i, Release 2, Version 8.1.6, which is the first version of Oracle to
support JDBC Version 2.0. Accordingly, the examples used in the book were tested with JDK
Version 1.2.2 and J2EE Version 1.2. Don't be discouraged if you're still using JDK 1.1.x. Most of
the examples, except for some of the J2EE stuff, work fine with JDK 1.1.5+. Even some of the
features that are new to JDBC 2.0, such as prefetching and batching, are supported under JDK
1.1.5+ via an additional Oracle import. All the program examples are available online at
http://examples.oreilly.com/jorajdbc/.

Oracle8i, Version 8.1.7, and Oracle9i both introduce new features that represent incremental
improvements to Oracle JDBC. We'll discuss the most important of these new features in
Chapter 20. Even though I used Oracle8i, Version 8.1.6 for all the examples in this book,
everything you read still applies to Oracle8i, Release 3, Version 8.1.7 and to Oracle9i.

Most of the filenames in my examples use the Windows path notation using backslashes instead
of forward slashes. I use this notation not out of preference for a particular operating system (my
preference is Unix), but because I feel most of you will be learning how to use Oracle JDBC on a
Win32 platform. So for you Unix/Linux programmers, forgive me for making you reach over the
Enter key.

Comments and Questions


Please address comments and questions concerning this book to the publisher:
O'Reilly & Associates, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
(800) 998-9938 (in the United States or Canada)
(707) 829-0515 (international/local)
(707) 829-0104 (fax)
There is a web page for this book, which lists errata, examples, or any additional information. You
can access this page at:
http://www.oreilly.com/catalog/jorajdbc
To comment or ask technical questions about this book, send email to:
[email protected]
For more information about books, conferences, Resource Centers, and the O'Reilly Network,
see the O'Reilly web site at:
http://www.oreilly.com
Acknowledgments
A Native American medicine man once told me, "A man needs a woman to teach him how to
live." With this I could not agree more. That said, I never would have been in a position to write
this book had it not been for the profound way in which my wife Diane has taught me how to live.
With her love, honesty, and tireless support, no matter how wacky some of my adventures or
ideas have been, she has always been there as a friend, pointing out that the only limits to my
ability were the ones I imagined. As a writing teacher, her advice has been immensely valuable. I
am truly grateful to have her help and advice. For the last year, while I have been writing this
book, she has pretty much lived without me. Yet she has been my sounding board on many
issues related to the book, and it all must have sounded like I was speaking another language. I
can't express in words how intensely I love her, but having the time to write this book is good
indication of how much she loves me. Thank you Diane!

This book was only half as good as it is now when I first turned my chapters over to my editor
Jonathan Gennick. The other half came from Jonathan's feedback. You can't imagine how
humbling it is to write a chapter of a book, edit yourself several times, send it to your editor, and
then get it returned to you with so many edit marks that it looks like it's the first paper you wrote in
your freshman year of high school. Nonetheless, through the process of editing emerges a work
that is better, better because of the teamwork between writer and editor. Thank you Jonathan!
And thank you also to Matt Hutchinson, production editor for the book, and to the entire O'Reilly
production team.

Also, a special thanks goes out to my technical reviewers: Kuassi Mensah, Java Products Group
Manager, Oracle Corporation; Shiva Prasad, Senior Product Manager, Oracle Corporation;
Ekkehard Rohwedder, SQLJ Development Manager, Oracle Corporation; Alan Beaulieu,
President, APB Solutions, Inc.; and Charles Havranek, President and CEO, xde.net. Your efforts
improved this book and are greatly appreciated!

Part I: Overview
Part I consists of a single chapter that introduces the JDBC API, defines the term
client/server as it will be used in the book, and provides a framework of four
different client types. Each of the four client types, which require a different
treatment when establishing a database connection, will be discussed in detail in
Part II.

1.1 The JDBC API


In this section, I will try to give you the big picture of the JDBC API. Given this overview, you'll
have a contextual foundation on which to lay your knowledge as you build it chapter by chapter
while reading this book.

The JDBC API is based mainly on a set of interfaces, not classes. It's up to the manufacturer of
the driver to implement the interfaces with their own set of classes. Figure 1-1 is a class
diagram that shows the basic JDBC classes and interfaces; these make up the core API. Notice
that the only concrete class is DriverManager. The rest of the core API is a set of interfaces.

Figure 1-1. The interfaces of the core JDBC API

I'll take a second to explain some of the relationships in the diagram. DriverManager is used to
load a JDBC Driver. A Driver is a software vendor's implementation of the JDBC API. After a
driver is loaded, DriverManager is used to get a Connection. In turn, a Connection is used
to create a Statement, or to create and prepare a PreparedStatement or
CallableStatement. Statement and PreparedStatement objects are used to execute
SQL statements. CallableStatement objects are used to execute stored procedures. A
Connection can also be used to get a DatabaseMetaData object describing a database's
functionality.

The results of executing a SQL statement using a Statement or PreparedStatement are


returned as a ResultSet. A ResultSet can be used to get the actual returned data or a
ResultSetMetaData object that can be queried to identify the types of data returned in the
ResultSet.

The six interfaces at the bottom of Figure 1-1 are used with object-relational technology. A
Struct is a weakly typed object that represents a database object as a record. A Ref is a
reference to an object in a database. It can be used to get to a database object. An Array is a
weakly typed object that represents a database collection object as an array. The SQLData
interface is implemented by custom classes you write to represent database objects as Java
objects in your application. SQLInput and SQLOutput are used by the Driver in the creation
of your custom classes during retrieval and storage.

In Oracle's implementation of JDBC, most of the JDBC interfaces are implemented by classes
whose names are prefixed with the word Oracle. Figure 1-2 shows these classes and is laid
out so that the classes correspond positionally with those shown in Figure 1-1.

Figure 1-2. Oracle's implementation of the JDBC API interfaces

As you can see from Figure 1-2, the only interface not implemented by an Oracle class is
SQLData. That's because you implement the SQLData interface yourself with custom classes
that you create to mirror database objects. Now that you've got the big picture for the JDBC API,
let's lay a foundation for understanding what I mean when I used the term client with respect to
JDBC.

1.2 Clients
In Part II, we'll examine how to establish JDBC connections from four types of Oracle clients: an
application, an applet, a servlet, and an internal client. But first, I need to define what I mean by
client. Let's begin that discussion by clarifying the term client/server.

1.2.1 What Is Client/Server?


Over the years, I've heard countless, sometimes convoluted, definitions for the term client/server.
This has led to a great deal of confusion when discussing application architecture or platforms.
So you have a consistent definition of the term client/server, I propose we use Oracle's early
definition for client/server and then define the four different types of clients we'll encounter in this
book.

It's my opinion that Oracle is in large part responsible for the definition and success of the so-
called client/server platform. From its beginnings, Oracle has been a client/server database.
Here's my definition of client/server:
Any time two different programs run in two separate operating-system processes
in which one program requests services from the other, you have a client/server
relationship.

In the early days, before the use of networks, Oracle applications consisted of the Oracle RDBMS
running on one operating-system process as the server and one or more end users running their
application programs in other operating-system processes. Even though this all took place on one
physical computer, it's still considered client/server. The Oracle RDBMS represents the server,
and the end-user application programs represent the clients.

With the use of networks, the communication between the client and server changed, but the
client/server relationship remained the same. The key difference was that client and server
programs were moved to different computers. Examples of this are the use of C, C++,
VisualBasic, PowerBuilder, and Developer 2000 to develop applications that run on personal
computers and in turn communicate with an Oracle database on a host computer using TCP/IP
via Net8. This type of scenario is what most people think of when they hear the term client/server.
I call this type of client/server architecture two-tier because the division of labor is a factor of two,
not because the client and server programs run on two different computers.

Now, with Java and the Java 2 Enterprise Edition (J2EE), which includes servlets and distributed
objects such as Enterprise JavaBeans (EJB), client/server applications have become
multitiered. Such multitier applications, which can have three, four, or even more tiers, are
referred to as n-tier applications (in which n is more than two tiers). For example, someone using
a browser on a PC can execute a servlet on another host computer. The computer on which the
servlet runs is known as an application server, and it in turn might execute EJB on a third host
computer, which would be known as a component server. The component server might contact
yet another server, a database server running Oracle, to retrieve and store data. In this example,
we have four tiers: personal computer, application server, component server, and database
server. Distributing the software over four computers is one means of scaling up an application to
handle a larger volume of transactions.

With respect to the n-tier application, it's possible to deploy that application so the application
server, component server, and database server are all on the same host computer. In such a
scenario, we would still call it an n-tier application because the division of labor among programs
is a factor greater than two. The key point to note is that while we can run all the server software
on the same host computer, the n-tier architecture allows us to distribute the application over
multiple servers if necessary. Did you notice in these last two examples how a server might also
be a client? The servlet running on the application server was the client to the EJB running on the
component server, and so forth.

Now that you have a better understanding of the term client-sever, let's continue by looking at the
different types of clients that utilize JDBC and Oracle.

1.2.2 Types of Clients


As far as application development using Java is concerned, prior to Oracle8i, there were two
types of clients: an application and an applet. Both run in a Java Virtual Machine (JVM), but an
applet runs in a browser, which in turn runs as an application. Typically, an application has liberal
access to operating-system resources, while an applet's access to those resources is restricted
by the browser. I say typically, because using the Java Security API can restrict an application's
access to operating-system resources, and with a signed applet, or security policies, you can gain
access to operating-system resources. Another distinction between applications and applets is
that while an application has a main( ) method, an applet does not. Yet another distinction is
how they are programmed to connect to the database. Because of these distinctions, it is useful
to consider applications and applets as two different types of clients.
With the coming of J2EE, servlets and EJB both became new types of clients. A servlet, a Java
replacement for a CGI program, is a Java class that runs inside a servlet container similar to how
an applet runs inside a browser. Typically, a servlet takes the input of an HTML form submitted by
a browser and processes the data. A servlet may also generate an HTML form or other dynamic
content. Servlets differ from applications in a couple of ways. Like applets, servlets have no
main( ) method. There are also differences in how you program a servlet to connect to a
database. More importantly, a servlet is an application component. One or more servlets are
written to create an application.

Moving on to component technology, EJB is a Java component model for creating enterprise
applications. EJB is a software component that runs in a component server, which is usually
referred to as a Component Transaction Monitor or EJB Container. Like applets and servlets, EJB
has special considerations when it comes to connecting to the database and performing
transactions. Therefore, we'll consider EJB as a fourth type of client.

With the release of Oracle8i, Oracle stored procedures could be written in Java and became a
new type of client. Connectivity for Java stored procedures is very simple. Because EJB and Java
stored procedures are both internal clients, we'll consider both of them as the fourth type, an
internal client. In summary, we have defined four different types of clients that may utilize JDBC:

• Applications

• Applets

• Servlets

• Internal objects

The important point is that each of these client types has a different set of requirements when it
comes to establishing a connection to the database. An application is the easiest type of client to
connect. That's because it has liberal access to operating-system resources; you typically just
make a connection when you start your program and then close it before you exit. An applet, on
the other hand, has to live with security, life cycle, and routing restrictions. A servlet has life cycle
and possible shared connection issues, and an internal client such as EJB or a stored procedure
has security issues.

It's common for programmers to have problems establishing a JDBC connection to an Oracle
database. Consequently, I'll discuss each type of client's requirements separately, and in detail, in
the chapters that follow. This should get you started on the right foot. Chapter 2 covers most of
the general knowledge you'll need, so even if you're interested only in connecting from applets,
servlets, or internally from Java stored procedures, read Chapter 2 first.

1.3 Using SQL


OK. Get ready. Here's my soapbox speech. A final word before you start. Don't make the mistake
of becoming dependent on a procedural language and forgetting how to use the set-oriented
nature of SQL to solve your programming problems. In other words, make sure you use the full
power of SQL. A common example of this phenomenon is the batch updating of data in a table.
Often, programmers will create a program using a procedural language such as PL/SQL or Java,
open a cursor on a table for a given set of criteria, then walk through the result set row by row,
selecting data from another table or tables, and finally updating the original row in the table with
the data. However, all this work can be done more quickly and easily using a simple SQL
UPDATE statement with a single- or multicolumn subquery.

I can't emphasize enough how important it is for you to know the SQL language in order to get
the most from using JDBC. If you don't have a lot of experience using SQL, I suggest you read
SQL in a Nutshell, by Kevin Kline with Daniel Kline (O'Reilly)or Oracle: The Complete Reference,
by George Koch and Kevin Loney (Osborne McGraw-Hill).

Part II: Connections


In Part II, we'll look at how to establish database connections within the context
of each one of the four clients defined in Introduction to JDBC:

• Applications

• Applets

• Servlets

• Internal objects

As part of our discussion on servlet connections, we'll look at various strategies


for managing pools of connections. Following the chapters on connections, we'll
continue by covering Oracle's advanced security features. Finally, we'll
investigate the JDBC optional package's connection pooling framework.

Chapter 2. Application Database Connections


In Introduction to JDBC, I defined four client types. In this chapter, I'll discuss how to make a
database connection from the first type of client, an application. Establishing a database
connection may sound like an easy task, but it's often not, because you lack the necessary
information. In this chapter, I'll not only explain the ins and outs of making a connection but also
talk about the different types of connections you can make and point out the advantages of each.

2.1 JDBC Drivers


In order to connect a Java application to a database using JDBC, you need to use a JDBC driver.
This driver acts as an intermediary between your application and the database. There are actually
several types of JDBC drivers available, so you need to choose the one that best suits your
particular circumstances. You also need to be aware that not all driver types are supported by
Oracle, and even when a driver type is supported by Oracle, it may not be supported by all
versions of Oracle.

2.1.1 Driver Types


Sun has defined four categories of JDBC drivers. The categories delineate the differences in
architecture for the drivers. One difference between architectures lies in whether a given driver is
implemented in native code or in Java code. By native code, I mean whatever machine code is
supported by a particular hardware configuration. For example, a driver may be written in C and
then compiled to run on a specific hardware platform. Another difference lies in how the driver
makes the actual connection to the database. The four driver types are as follows:
Type 1: JDBC bridge driver
This type uses bridge technology to connect a Java client to a third-party API such as
Oracle DataBase Connectivity (ODBC). Sun's JDBC-ODBC bridge is an example of a
Type 1 driver. These drivers are implemented using native code.
Type 2: Native API (part Java driver)
This type of driver wraps a native API with Java classes. The Oracle Call Interface (OCI)
driver is an example of a Type 2 driver. Because a Type 2 driver is implemented using
local native code, it is expected to have better performance than a pure Java driver.
Type 3: Network protocol (pure Java driver)
This type of driver communicates using a network protocol to a middle-tier server. The
middle tier in turn communicates to the database. Oracle does not provide a Type 3
driver. They do, however, have a program called Connection Manager that, when used in
combination with Oracle's Type 4 driver, acts as a Type 3 driver in many respects.
Connection Manager will be covered in Chapter 3.
Type 4: Native protocol (pure Java driver)
This type of driver, written entirely in Java, communicates directly with the database. No
local native code is required. Oracle's Thin driver is an example of a Type 4 driver.

It's a popular notion that drivers implemented using native code are faster than pure Java drivers
because native code is compiled into the native op-code language of the computer, whereas Java
drivers are compiled into byte code. Java drivers have their CPU instructions executed by a Java
Virtual Machine (JVM) that acts as a virtual CPU, which in turn has its commands executed by
the computer's real CPU. On the other hand, the code for native code drivers is executed directly
by the real CPU. Because the JVM represents an additional layer of execution, common sense
would seem to dictate that native code would execute faster. However, as you will see in
Chapter 19, this is not always the case. Most of the time, Oracle's Java driver is faster than its
native driver.

2.1.2 Oracle's JDBC Drivers


Oracle provides Type 2 and Type 4 drivers for both client- and server-side use. Client-side refers
to the use of the driver in an application, applet or servlet, whereas server-side refers to the use
of the driver inside the database. Here's a list of Oracle's JDBC drivers:
JDBC OCI driver
This is a Type 2 driver that uses Oracle's native OCI interface. It's commonly referred to
as the OCI driver. There are actually two separate drivers, one for OCI7 (Oracle release
7.3.x) and another for OCI8 (Oracle release 8.x). This driver is for client-side use and
requires that the Oracle client software be installed.
JDBC Thin driver
This is a Type 4, 100% pure Java driver for client-side use.
JDBC internal driver
This is a Type 2, native code driver for server-side use with Java code that runs inside
the Oracle8i database's JServer JVM. It's also called the kprb driver.
JDBC server-side Thin driver
This is a Type 4 100% pure Java driver for server-side use with Java code that runs
inside the Oracle8i database's JServer JVM that must also access an external data
source.

Figure 2-1 shows the JDBC driver architecture on the Win32 platform. On the client side are the
JDBC-ODBC bridge (supplied by Sun, not Oracle), the JDBC OCI driver, and the JDBC Thin
driver. All three communicate with the listener process on the server. The difference in
architecture is in the software layers between the JDBC driver and the listener. As you can see
from Figure 2-1, the JDBC Thin driver communicates directly with the listener. The JDBC OCI
driver, on the other hand, must communicate with the OCI native software, which in turn
communicates with the listener. Even more removed from the listener is the JDBC-ODBC Bridge.
The JDBC-ODBC Bridge driver communicates with an ODBC driver. In turn, the ODBC driver
communicates with OCI native software, which in turn finally communicates with the listener. The
fact that the JDBC Thin driver communicates directly with the listener is probably why it performs
just as well as its native-mode counterpart in most cases.

Figure 2-1. Oracle driver architecture

In order to keep things concise, from now on I'll refer to the JDBC OCI driver as the OCI driver
and the JDBC Thin driver as the Thin driver. Whenever we discuss server-side drivers, I'll qualify
the Thin driver as the server-side Thin driver. Otherwise, we're always talking about client-side
drivers.

2.1.3 Guidelines for Choosing a Driver


Given that the drivers have subtle variations in their capabilities and are not applicable to
universal client usage, you must decide ahead of time which driver to use for any given
application. As you progress through this book, you'll learn about the varying capabilities of the
drivers, but for now, here are some guidelines for choosing an appropriate driver for your
applications:
Two-tier client/server application
I suggest you use the Thin driver for all two-tier, client/server applications. The one
exception is for applications making heavy use of stored procedures. For those, you
should use the OCI driver. Note that this is contrary to Oracle's recommendation. Oracle
recommends that for maximum performance, you always use the OCI driver with two-tier,
client/server applications. I disagree with Oracle's recommendation because the
difference in performance between the OCI driver and the Thin driver is nominal in most
instances, yet installing the Oracle client software to support the OCI driver can become
a costly software configuration management issue.
Servlet or applet
I suggest you use the Thin driver for portability when writing servlets and applets. For an
applet, you have no choice but to use the Thin driver. It is a pure Java driver that allows a
direct connection to the database by emulating Net8's protocol on top of Java sockets
(TCP/IP).
Middle-tier program residing in a database
I suggest you use the server-side internal driver if your program resides in a database
and uses only resources, such as Enterprise JavaBeans (EJB) and stored procedures, in
that database.
Middle-tier program residing in a database, but accessing outside resources
Other documents randomly have
different content
qu’il y trouvât de quoi vivre, attendu que le territoire ci-dessus
désigné était ravagé et abandonné, sous la condition qu’il se ferait
chrétien. — Comment le roi, Robert, duc de France, les autres
grands et les évêques jurèrent que ce pays serait possédé à
perpétuité par Rollon et par ses héritiers; et comment Rollon ne
voulant pas baiser le pied du roi, ordonna à un de ses chevaliers de
le baiser. [p. 51]
CHAP. XVIII. Comment, l’an du Verbe incarné 912, Rollon et son armée
reçurent le baptême, et Rollon donna une portion de son territoire
aux églises les plus vénérables avant d’en faire la distribution entre
les grands, et comme quoi il donna Brenneval à Saint-Denis
l’Aréopagite. [p. 54]
CHAP. XIX. Comment Rollon distribua le pays à ses hommes, releva les
églises détruites et les murailles des cités, et vainquit les Bretons
révoltés contre lui. [p. 55]
CHAP. XX. De la loi qu’il publia pour que nul n’eût à prêter assistance à
un voleur. — Histoire d’un paysan et de sa femme, qu’il ordonna de
pendre à une potence, à cause d’une serpe et d’un soc de charrue
qui avaient été volés. [p. 56]
CHAP. XXI. De deux chevaliers du roi Chartes, que le duc fit punir. [p. 58]
CHAP. XXII. Comment le duc, après que sa femme fut morte sans lui
laisser d’enfans, s’unit de nouveau avec Popa, qu’il avait eue pour
femme avant son baptême, et mourut après avoir fait prêter
serment de fidélité à son fils Guillaume par les Normands et les
Bretons. [p. 59]

LIVRE TROISIÈME.
DU SECOND DUC DE NORMANDIE, GUILLAUME, FILS DE ROLLON.
CHAPITRE PREMIER. Des bonnes qualités du duc Guillaume et de la
jalousie des Francs contre lui, parce qu’il reculait tout autour de lui
les limites de son duché. — Comment il vainquit les comtes bretons
Alain et Béranger, révoltés contre lui. [p. 61]
CHAP. II. Comment quelques Normands, sous la conduite d’un certain
traître nommé Rioulfe, voulurent entreprendre d’expulser le duc du
pays, et étant venus assiéger les faubourgs de la ville de Rouen,
furent vaincus par le duc, qui n’avait avec lui qu’une petite troupe de
chevaliers, dans le lieu que l’on appelle encore aujourd’hui le Pré du
combat; et comment le duc revenant vainqueur après cette affaire,
apprit que Sprota, très-noble jeune fille, lui avait donné un fils, né à
Fécamp, qu’il ordonna de baptiser sous le nom de Richard. [p. 62]
CHAP. III. Comment beaucoup de comtes et de ducs des contrées
étrangères, attirés vers le duc par la renommée de sa bonté et de
ses vertus, visitèrent sa cour, et entre autres Hugues-le-Grand, duc
des Francs, Guillaume, comte de Poitou, et Héribert du Vermandois.
— Comment Guillaume demanda au duc, et en obtint sa sœur Gerloc
en mariage; et comment Héribert, sur les instances de Hugues-le-
Grand, donna sa fille en mariage au duc. [p. 64]
CHAP. IV. Comment, sur la demande d’Elstan, roi des Anglais, le duc
rétablit Louis sur le trône de ses pères, et le décora du diadème
royal après qu’il eut reçu l’onction de l’huile sainte, soutenu qu’il
était par Hugues-le-Grand, par les évêques et par les autres grands
seigneurs Francs. — Comment au bout de cinq ans les Francs
conspirèrent de nouveau contre leur roi, et tentèrent de l’expulser de
son royaume. [p. 65]
CHAP. V. Comment Louis, forcé par la nécessité, voulut conclure un
traité d’amitié avec Henri, roi d’outre-Rhin, et que celui-ci ne voulut y
consentir qu’avec l’intervention de Guillaume, marquis des
Normands. — Par où Louis, ayant supplié instamment le duc, obtint
par lui le secours et l’alliance qu’il recherchait auprès du roi Henri.
[p. 66]
CHAP. VI. Comment à son retour de la conférence des rois, et sur la
demande de Louis, le duc Guillaume présenta sur les fonts du
baptême, à Laon, le fils du roi qui reçut le nom de Lothaire. [p. 67]
CHAP. VII. En quelle occasion le duc Guillaume releva l’abbaye de
Jumiège, que les Païens avaient détruite. [p. 68]
CHAP. VIII. De douze moines et de leur abbé Martin, qui furent pris
dans le couvent de Saint-Cyprien, et que la comtesse de Poitou,
sœur du duc, lui envoya sur sa demande pour être établis dans le
lieu susdit. — Comment le duc voulant se faire moine en ce même
lieu, en reçut défense de l’abbé lui-même; et comment il fit jurer
fidélité à son fils Richard par les Normands et les Bretons. [p. 70]
CHAP. IX. Comment Hérold, roi des Danois, chassé de son royaume
par son fils Suénon, et arrivant en Normandie avec soixante
vaisseaux, fut accueilli par le duc Guillaume avec les honneurs
convenables; et comment ce duc lui concéda le comté de Coutances
pour y demeurer. [p. 72]
CHAP. X. Comment le duc Guillaume, touché des malheurs du comte
Herluin, investit, assiégea et prit le château de Montreuil, qu’Arnoul
de Flandre lui avait enlevé, et le rendit à Herluin. [p. 73]
CHAP. XI. Comment Arnoul, attristé de la perte de ce château, adressa
frauduleusement au duc Guillaume des paroles de paix pour l’inviter
à se rendre à Pecquigny, afin d’y négocier avec lui un traité d’amitié.
[p. 74]

CHAP. XII. Comment quatre traîtres, savoir, Henri, Balzon, Robert et


Rioulfe, assassinèrent le duc par les ordres d’Arnoul, dans une
certaine île du fleuve de la Somme. — De la clef d’argent qui fut
trouvée dans sa ceinture, et avec laquelle il gardait enfermés dans
un petit coffre un capuchon et une étamine de moine. — Comment
son corps fut transporté à Rouen. [p. 75]

LIVRE QUATRIÈME.
er
DE RICHARD I , FILS DU DUC GUILLAUME.

CHAPITRE PREMIER. Comment Richard, encore enfant, succéda à son


père Guillaume. [p. 78]
CHAP. II. Comment Louis, roi des Francs, étant venu à Rouen, et
emmenant frauduleusement le jeune Richard en France et avec lui,
soumit le duché de Normandie à sa juridiction, en se disant tuteur
de l’enfant. [p. 79]
CHAP. III. Comment Louis, aveuglé par les présens d’Arnoul, menaça le
jeune Richard, duc de Normandie, de lui brûler les jarrets. [p. 80]
CHAP. IV. Par quelle adresse Osmond, intendant du jeune Richard, le
délivra de son étroite prison, et l’ayant enlevé de Laon, le conduisit à
Senlis auprès du comte Bernard, son oncle. [p. 82]
CHAP. V. Comment Bernard le Danois déjoua par sa sagesse les
conseils que Hugues-le-Grand avait donnés au roi contre les
Normands. [p. 84]
CHAP. VI. Comment Louis, se rendant à Rouen, y fut reçu par Bernard
le Danois et par les autres citoyens; et comment sur son ordre
Hugues-le-Grand renonça à dévaster la Normandie. [p. 85]
CHAP. VII. Comment par l’habileté de Bernard le Danois, et par le
secours d’Hérold, roi des Danois, Louis, roi des Francs, fut fait
prisonnier et retenu dans la ville de Rouen en une dure captivité.
[p. 88]

CHAP. VIII. Comment la reine Gerberge demanda à son père Henri, roi
d’au delà du Rhin, du secours contre les Normands, et n’en obtint
pas; c’est pourquoi elle donna comme otages son fils et deux
évêques, en échange du roi Louis, son époux. [p. 90]
CHAP. IX. Comment les Normands ramenèrent de France leur seigneur
Richard, et rendirent les otages. — Retour du roi Hérold en
Danemarck. [p. 91]
CHAP. X. Comment Hugues-le-Grand fiança sa fille Emma avec le duc
Richard, en sorte que le roi Louis, et Arnoul, comte de Flandre,
effrayés, demandèrent au roi Othon son secours contre Hugues-le-
Grand et le duc Richard; et comment Othon, après avoir dévasté le
territoire de Hugues-le-Grand, entreprit d’assiéger Rouen. [p. 92]
CHAP. XI. Comment l’empereur Othon, le roi Louis et Arnoul de
Flandre, abandonnèrent honteusement le siége de Rouen, et prirent
la fuite. — Mort du roi Louis, qui eut pour successeur Lothaire, son
fils. [p. 94]
CHAP. XII. Comment Hugues-le-Grand, sur le point de mourir, plaça
son fils Hugues sous la protection du duc Richard; et comment ce
même duc prit pour femme Emma, fille de Hugues, après la mort de
celui-ci. [p. 96]
CHAP. XIII. Quels conseils Thibaut, comte de Chartres, donna à la reine
Gerberge contre le duc Richard; et comment ces artifices furent
révélés au duc par deux chevaliers de Thibaut même. [p. 96]
CHAP. XIV. Comment le roi Lothaire ayant réuni les ennemis du duc
Richard, savoir, Baudouin, comte de Flandre, Geoffroi d’Anjou et
Thibaut de Chartres, voulut encore le tromper, mais il ne le put.
[p. 98]

CHAP. XV. Comment le roi Lothaire s’empara de la ville d’Evreux et la


livra à Thibaut. — Comment le duc Richard dévasta le comté de
Chartres et de Châteaudun. — Comment Thibaut étant arrivé avec
une armée à la ferme d’Ermentrude, en fut chassé par le duc, et prit
honteusement la fuite, après avoir reçu un grand échec. [p. 100]
CHAP. XVI. Comment le duc Richard demanda à Hérold, roi des Danois,
des secours contre les Francs, et en reçut bientôt. [p. 101]
CHAP. XVII. Comment forcés par la nécessité, le roi Lothaire et Thibaut
rendirent intégralement au duc Richard tout ce qu’ils lui avaient
enlevé. — Conversion des Païens sur les exhortations du duc. [p. 103]
CHAP. XVIII. Comment, sa femme Emma étant morte sans laisser
d’enfans, le duc épousa Gunnor, dont il eut plusieurs enfans. [p. 104]
CHAP. XIX. Comment le duc Richard construisit à Fécamp, en l’honneur
de la Sainte-Trinité, une église, qu’il décora de divers ornemens, et
restaura les abbayes du Mont-Saint-Michel et de Saint-Ouen.
— Comment après la mort du roi Lothaire, Hugues-Capet s’éleva à la
royauté, et étant mort peu de temps après, eut pour successeur
Robert son fils. [p. 106]
CHAP. XX. Comment le duc Richard, se trouvant à toute extrémité,
donna aux Normands son fils Richard pour duc, et mourut ensuite à
Fécamp. [p. 108]

LIVRE CINQUIÈME.
er
DU DUC RICHARD II, FILS DE RICHARD I .

CHAPITRE PREMIER. De l’honorable conduite de Richard II, tant pour les


affaires du siècle que pour les affaires divines. [p. 110]
CHAP. II. Avec quelle sagesse il réprima la conspiration générale
tramée par les paysans contre la paix. [p. 111]
CHAP. III. De la rébellion de Guillaume, frère naturel du duc, à qui
celui-ci avait donné le comté d’Hiesme. — Comment ce même
Guillaume fut pris, se réconcilia ensuite avec son frère, reçut du duc
le don du comté d’Eu et une femme nommée Lezscenina, et en eut
trois fils. [p. 112]
CHAP. IV. Comment Edelred, roi d’Angletere, qui, avait épousé Emma,
sœur du duc, envoya une armée pour conquérir la Normandie; et
comment Nigel de Coutances vainquit et détruisit entièrement cette
armée. [p. 114]
CHAP. V. Comment Geoffroi, comte des Bretons, demanda et obtint
pour femme la sœur du duc Richard, nommée Hadvise, dont il eut
deux fils, Alain et Eudes. [p. 116]
CHAP. VI. De la cruauté d’Edelred, roi des Anglais, envers les Danois
qui demeuraient paisiblement chez lui, en Angleterre; et de la fuite
de quelques jeunes gens de la même nation qui s’échappèrent pour
aller annoncer à Suénon, roi de Danemarck, la mort de ses proches.
[p. 117]

CHAP. VII. Comment le roi Suénon, ayant rassemblé une grande


armée, débarqua dans le comté d’Yorck, et laissant là son armée,
partit pour aller demander la paix à Richard, duc de Normandie, et
arriva à Rouen avec quelques vaisseaux. — Du traité conclu entre les
Normands et les Danois. — Comment les habitans d’Yorck, de
Cantorbéry et de Londres se rendirent au roi Suénon; et comment le
roi Edelred s’enfuit avec sa femme et ses enfans auprès de Richard,
duc de Normandie. [p. 119]
CHAP. VIII. De la mort du roi Suénon à Londres; et comment Canut
son fils, lui ayant succédé, conduisit une nouvelle armée contre les
Anglais. — Du retour d’Edelred en Angleterre, et de la victoire des
Danois à Sandwich. [p. 121]
CHAP. IX. Comment Edelred, roi des Anglais, étant mort, Canut, roi des
Danois, épousa sa veuve Emma, et en eut un fils, Hardi-Canut, qui
dans la suite lui succéda. [p. 122]
CHAP. X. Des dissensions qui s’élevèrent entre le duc Richard et
Eudes, comte de Chartres, au sujet du château de Dreux.
— Comment le duc construisit le château de Tilliers sur la rivière
d’Avre; et comment les Normands vainquirent Eudes, et deux comtes
qui s’étaient joints à lui. [p. 123]
CHAP. XI. Comment deux rois païens vinrent d’au delà des mers pour
secourir le duc Richard contre les Francs. [p. 125]
CHAP. XII. Comment Robert, roi des Francs, redoutant les rois susdits,
rétablit la paix entre le duc Richard et Eudes. [p. 127]
CHAP. XIII. Comment le duc Richard prit pour femme Judith, sœur de
Geoffroi, comte des Bretons, et des enfans qu’il en eut. [p. 128]
CHAP. XIV. Comment Robert, roi des Francs, aidé du duc Richard,
rendit à Bouchard le château de Melun. [p. 129]
CHAP. XV. Comment avec le secours du duc Richard, le roi des Francs,
Robert, prit possession, malgré les Bourguignons, du duché de
Bourgogne, que le duc Henri lui avait laissé eu mourant. [p. 130]
CHAP. XVI. Comment Renaud, comte des Bourguignons, d’outre-Saône,
épousa là fille du duc Richard, Adelise. [p. 131]
CHAP. XVII. Comment le duc Richard, se trouvant à toute extrémité,
remit son duché à Richard, son fils aîné. [p. 133]

LIVRE SIXIÈME.
DE RICHARD III ET DE ROBERT SON FRÈRE, TOUS DEUX FILS DE RICHARD II.

CHAPITRE PREMIER. Comment Richard III, quoiqu’il n’ait pas long-temps


gouverné le duché, se montra cependant imitateur des vertus de son
père. [p. 135]
CHAP. II. Des dissensions qui s’élevèrent entre Richard et Robert son
frère, et de la mort de Richard après le rétablissement de la paix
entre eux. [p. 136]
CHAP. III. Comment Robert succéda à son frère Richard. — De son
caractère et des dissensions qui naquirent entre lui et l’archevêque
Robert. [p. 137]
CHAP. IV. Comment le même duc Robert assiégea Guillaume de
Belesme dans le château d’Alençon, et le força à se rendre. [p. 138]
CHAP. V. Comment Hugues, évêque de Bayeux, et fils du comte Raoul,
voulut s’emparer du château d’Ivry, et ne put y réussir. [p. 140]
CHAP. VI. Comment Baudouin, comte de Flandre, demanda pour son
fils Baudouin la fille de Robert, roi des Francs, et l’obtint, pour son
malheur, si Robert, duc de Normandie, ne lui eut prêté secours.
— Mort de Robert, roi des Francs, qui eut pour successeur Henri son
fils. [p. 141]
CHAP. VII. Comment le même duc prêta son assistance à Henri, roi des
Francs, contre Constance sa mère. [p. 143]
CHAP. VIII. Comment le duc Robert, ayant marché contre Alain, comte
des Bretons, fonda le château de Carroc, sur les rives de la rivière du
Coesnon. [p. 145]
CHAP. IX. De l’abbaye du Bec, de son premier abbé et fondateur, le
vénérable Herluin, et de son successeur Anselme. [p. 146]
CHAP. X. De la flotte que le duc Robert se dispos à envoyer en
Angleterre, au secours de ses cousins Edouard et Alfred, fils du roi
Edelred. [p. 160]
CHAP. XI. Comment le duc envoya une partie de sa flotte pour
dévaster la Bretagne, et comment la paix fut rétablie ensuite entre
lui et Alain, comte de Bretagne. [p. 162]
CHAP. XII. Comment Canut, roi des Anglais, offrit par des députés, à
Edouard et à Alfred, la moitié du royaume d’Angleterre, par suite de
la crainte que lui inspirait Robert, duc de Normandie. — Et comment
le duc, partant ensuite pour Jérusalem, mit à la tête du duché de
Normandie son fils Guillaume, âgé de cinq ans. [p. 163]
CHAP. XIII. Comment le même duc, revenant de Jérusalem, mourut
dans la ville de Nicée, dans le sein du Christ. [p. 165]

LIVRE SEPTIÈME.
DU DUC GUILLAUME, QUI SOUMIT L’ANGLETERRE PAR SES ARMES.

CHAPITRE PREMIER. Des traverses que le jeune Guillaume eut à essuyer


dès le commencement de son administration, par la perversité de
quelques hommes. [p. 166]
CHAP. II. De la guerre qui s’éleva entre Toustain de Montfort et
Gauchelin de Ferrières; et de la mort d’Osbern, fils d’Herfast. [p. 167]
CHAP. III. Comment Roger de Beaumont, fils de Honfroi de Vaux,
envoyé par les ordres de celui-ci, vainquit Roger du Ternois. [p. 169]
CHAP. IV. Comment ce même Roger de Beaumont fonda l’abbaye de
Préaux, et épousa Adeline, fille de Galeran, comte de Meulan. [p. 170]
CHAP. V. Comment Henri, roi des Francs, livra aux flammes le château
de Tilliers, que les Normands lui avaient cédé pour obtenir la paix,
ainsi que le bourg d’Argentan. [p. 172]
CHAP. VI. Comment Toustain Guz voulut et ne put retenir le château
de Falaise, et le défendre contre le duc Guillaume. — De Richard, fils
de Toustain. [p. 173]
CHAP. VII. Comment Robert l’archevêque eut pour successeur Manger,
fils de Richard II, et de sa seconde femme Popa. — De Guillaume
d’Arques. [p. 175]
CHAP. VIII. Comment Canut, roi des Anglais, étant mort, eut pour
successeur son fils Hérold. — Ce que fit Edouard encore exilé. [p. 177]
CHAP. IX. Comment Alfred, frère d’Edouard, fut trahi par le comte
Godwin; et comment Hardi-Canut, fils d’Emma, mère d’Edouard,
succéda à Hérold son frère, et eut pour successeur Edouard, qui
épousa Edith, fille de Godwin. [p. 177]
CHAP. X. Des cruautés de Guillaume Talvas. — De Guillaume, fils de
Giroie, qui se fit moine au Bec. [p. 179]
CHAP. XI. Comment le duc Richard avait donné les deux châteaux de
Montreuil et d’Echaufour à Giroie, qui avait épousé Gisèle, fille de
Toustain de Montfort. [p. 181]
CHAP. XII. D’Arnoul, fils de Guillaume Talvas, et d’Olivier son frère,
moine du Bec. [p. 182]
CHAP. XIII. Comment, après la mort d’Arnoul, Ives, son oncle paternel,
évêque de Seès, entra en possession de ses terres par droit
d’héritage. [p. 183]
CHAP. XIV. Comment les fils de Guillaume Soreng, Richard, Robert et
Avesgot, moururent d’une juste mort. [p. 185]
CHAP. XV. Du concile que le pape Léon tint à Rheims, et de la
réprimande qu’il adressa à Ives, évêque de Seès, à cause de
l’incendie de l’église de Saint-Gervais. [p. 187]
CHAP. XVI. Comment Guillaume Talvas, frère de l’évêque Ives, donna à
Roger de Mont-Gommeri sa fille Mabille et ses terres. [p. 188]
CHAP. XVII. Comment, après la mort de Hugues, évêque de Bayeux, le
duc Guillaume mit en sa place Eudes, son frère utérin. — Bataille du
Val-des-Dunes. [p. 189]
CHAP. XVIII. Comment le duc Guillaume reprit les châteaux d’Alençon
et de Domfront, dont Geoffroi, comte d’Anjou, s’était emparé. [p. 192]
CHAP. XIX. Comment, ayant expulsé Guillaume Guerlenc du comté de
Mortain, le duc mit en sa place Robert, son frère utérin. [p. 194]
CHAP. XX. De la rébellion de Guillaume Busac, comte d’Eu; et comment
celui-ci étant exilé reçut en don le comté de Soissons de Henri, roi
des Francs. [p. 196]
CHAP. XXI. Le duc Guillaume épouse Mathilde, fille de Baudouin de
Flandre, et nièce du roi Henri. [p. 197]
CHAP. XXII. Des monastères qui furent fondés en Normandie du temps
du duc Guillaume. [p. 198]
CHAP. XXIII. De la reconstruction du couvent de Saint-Evroul, à Ouche,
par Guillaume Giroie, et Robert et Hugues de Grandménil, ses
neveux. [p. 201]
CHAP. XXIV. Comment Mauger l’archevêque remit son archevêché au
duc, lequel mit en sa place le moine Maurile. [p. 207]
CHAP. XXV. Comment le duc Guillaume construisit le château de
Breteuil, et le confia à Guillaume, fils d’Osbern. — Quelle était la
femme de celui-ci. [p. 209]
CHAP. XXVI. Pour quel motif deux couvens furent fondés à Caen. [p. 211]
CHAP. XXVII. Comment le duc Guillaume assiégea et prit la ville du
Mans, et le château de Mayenne. [p. 213]
CHAP. XXVIII. Comment Henri, roi des Français, perdit une armée au
gué de la Dive, se réconcilia ensuite avec le duc, et lui rendit le
château de Tilliers. [p. 213]
CHAP. XXIX. Comment, sur les délations de quelques hommes, le duc
Guillaume chassa de Normandie quelques uns de ses barons. [p. 213]
CHAP. XXX. En quel temps les Normands commencèrent à aller dans la
Pouille, et quels furent les princes Normands qui soumirent ce pays à
leur autorité. [p. 217]
CHAP. XXXI. Comment Harold engagea sa foi au duc Guillaume, et se
parjura ensuite, après la mort du roi Edouard. [p. 220]
CHAP. XXXII. Comment le duc Guillaume envoya en Angleterre le comte
Toustain, qui redoutant Harold se réfugia auprès du roi de Norwège.
[p. 221]

CHAP. XXXIII. De la mort de Conan, comte des Bretons. [p. 222]


CHAP. XXXIV. Du nombre de navires que le duc Guillaume conduisit en
Angleterre. [p. 224]
CHAP. XXXV. Comment le roi Harold dédaigna les conseils de sa mère et
de son frère, qui voulaient le détourner de combattre avec les
Normands. [p. 225]
CHAP. XXXVI. Comment le duc des Normands, Guillaume, vainquit les
Anglais révoltés contre lui. [p. 226]
CHAP. XXXVII. Comment les gens de Londres se rendirent au duc; et
comment, le jour de la naissance du Seigneur, le duc fut fait roi des
Anglais, à Londres. — De l’abbaye de la Bataille. [p. 228]
CHAP. XXXVIII. Du retour du duc en Normandie, et de la mort de
l’archevêque Maurile, qui eut Jean pour successeur. [p. 229]
CHAP. XXXIX. Comment Eustache, comte de Boulogne, fut repoussé du
château de Douvres, qu’il avait assiégé tandis que le roi Guillaume
était en Normandie. [p. 233]
CHAP. XL. Comment des brigands d’Angleterre, préparant une
rébellion, construisirent le château de Durham, et furent détruits.
[p. 234]

CHAP. XLI. Comment Brian, fils d’Eudes, comte de la petite Bretagne,


vainquit les deux fils du roi Harold et l’armée du roi d’Irlande. [p. 236]
CHAP. XLII. Comment le roi Guillaume, parcourant l’Angleterre, fit
construire beaucoup de châteaux pour la défense du royaume.
[p. 237]

CHAP. XLIII. De la mort de Robert Guiscard, duc de Pouille; de sa


valeur et de ses descendans; et comment Roger son neveu devint
roi. [p. 238]
CHAP. XLIV. De la mort de Guillaume, roi des Anglais et duc des
Normands, et comment il fut enseveli à Caen. [p. 240]

LIVRE HUITIÈME.
er
DE HENRI I , ROI DES ANGLAIS ET DUC DES NORMANDS.

CHAPITRE PREMIER. Préface à l’Histoire des faits et gestes du roi Henri,


dans laquelle il est montré, en peu de mots, meilleur que ses frères.
[p. 242]

CHAP. II. Comment après la mort du roi Guillaume, Guillaume, frère de


Henri, passa en Angleterre, et y fut fait roi, et Robert acquit le duché
de Normandie; et comment ce même Robert donna et retira ensuite
à Henri le comté de Coutances. [p. 244]
CHAP. III. De l’accord qui fut conclu entre Guillaume, roi des Anglais,
et Robert, duc de Normandie, son frère; et comment ils assiégèrent
leur frère Henri dans le mont Saint-Michel. [p. 246]
CHAP. IV. Comment le roi Guillaume étant retourné en Angleterre,
Henri se remit en possession du comté de Coutances. [p. 248]
CHAP. V. Comment les gens du Maine, voyant le duc Robert retenu en
Normandie par toutes sortes de difficultés, prirent pour comte Hélie,
fils de Jean de La Flèche. [p. 249]
CHAP. VI. Comment Anselme, abbé du Bec, ayant été promu à
l’archevêché de Cantorbéry, Guillaume, moine du même lieu, lui
succéda. [p. 250]
CHAP. VII. Comment Robert, duc de Normandie, ayant engagé son
duché à Guillaume, roi des Anglais, son frère, partit pour Jérusalem.
[p. 251]

CHAP. VIII. De la valeur que Guillaume déploya pour les intérêts de son
royaume; et comment il persécuta l’église de Dieu et ses serviteurs.
[p. 252]

CHAP. IX. De la mort du roi Guillaume dans la Forêt-Neuve.


— Comment Richard, son frère, était mort auparavant en ce même
lieu; et de ce qui causa leur mort, selon l’opinion du peuple. [p. 255]
CHAP. X. Comment Henri son frère, lui succéda, et prit pour femme
Mathilde fille du roi d’Ecosse. [p. 256]
CHAP. XI. Que le roi eut de la reine Mathilde un fils nommé Guillaume,
et une fille qui dans la suite des temps fut mariée à Henri, empereur
des Romains. [p. 257]
CHAP. XII. Comment le duc Robert, de retour de Jérusalem, passa en
Angleterre pour enlever à son frère son royaume; et comment ils se
réconcilièrent. [p. 258]
CHAP. XIII. Comment, ce marché ayant été rompu, Henri fit Robert
prisonnier à la bataille de Tinchebray, et de ce moment jusqu’à sa
mort gouverna sagement le royaume d’Angleterre et le duché de
Normandie. [p. 260]
CHAP. XIV. De Sibylle, épouse du duc Robert, et de Guillaume son fils;
et comment celui-ci devint comte de Flandre. [p. 262]
CHAP. XV. De Guillaume, comte de Hertford, et de ses successeurs.
[p. 264]

CHAP. XVI. De la mort de Guillaume, comte de Flandre. [p. 268]


CHAP. XVII. Mort de Philippe, roi des Français, qui eut pour successeur
Louis, son fils. — De l’origine des comtes d’Evreux et de leur
postérité. [p. 269]
CHAP. XVIII. Des querelles survenues entre le roi Henri et Amaury,
comte de la ville d’Evreux. [p. 270]
CHAP. XIX. De la guerre entre Louis, roi des Français, et Henri, roi des
Anglais. [p. 270]
CHAP. XX. Comment le roi Henri retourna en Angleterre après avoir fait
la paix avec le roi Louis; et de la mort de Guillaume son fils. [p. 270]
CHAP. XXI. De la querelle survenue entre ce môme roi et Galeran,
comte de Meulan; et comment elle fut terminée. [p. 271]
CHAP. XXII. Avec quelle habileté le même roi gouverna paisiblement
tous ses domaines. [p. 272]
CHAP. XXIII. Ce que fit le roi, par amour pour la justice, contre les
changeurs pervers, dans presque toute l’Angleterre. [p. 274]
CHAP. XXIV. De la mort de Guillaume, abbé du Bec, et des bonnes
qualités du vénérable Boson, son successeur. [p. 275]
CHAP. XXV. Comment, après la mort de l’empereur Henri, sa veuve
Mathilde l’impératrice étant revenue en Angleterre, le roi Henri, son
père, la donna en mariage à Geoffroi, duc d’Anjou, qui eut d’elle trois
fils, Henri, Geoffroi et Guillaume. [p. 277]
CHAP. XXVI. Comment les rois des Français descendent de la famille
des comtes d’Anjou. [p. 278]
CHAP. XXVII. Comment la susdite impératrice, étant tombée malade,
donna très-dévotement ses trésors à diverses églises et aux pauvres.
[p. 281]
CHAP. XXVIII. Comment, lorsqu’elle désespérait de sa vie, elle demanda
au roi la permission d’être ensevelie au Bec; et de l’affection qu’elle
avait pour celte église. — Comment elle recouvra la santé. [p. 283]
CHAP. XXIX. Comment le roi Henri épousa Adelise, après la mort de sa
femme Mathilde; et des enfans qu’il eut d’ailleurs dont le premier-né
fut Robert, comte de Glocester, qui obtint l’héritage de Robert, fils
d’Aimon, et sa fille. [p. 284]
CHAP. XXX. Geoffroi, archevêque de Rouen, qui depuis long-temps
avait succédé à Guillaume, étant mort, Hugues, abbé de Radinges
fut promu à ce siége. [p. 287]
CHAP. XXXI. Des châteaux que le roi Henri bâtit dans son duché de
Normandie. — Comment il maintint la paix par sa sagesse, non
seulement dans ses États, mais encore dans des contrées très-
éloignées. [p. 287]
CHAP. XXXII. Des églises et des monastères que le roi a bâtis; de ses
largesses envers les serviteurs du Christ, et de ses autres œuvres
pies. [p. 289]
CHAP. XXXIII. De la mort du roi; et comment son corps fut transporté
en Angleterre et enseveli à Reading. [p. 292]
CHAP. XXXIV. Des quatre sœurs du susdit roi, entre autres d’Adèle qui
avait épousé Etienne, comte de Blois, et des fils qu’elle en eut.
[p. 295]

CHAP. XXXV. Comment Roger de Mont-Gomeri était fils d’une


descendante de la comtesse Gunnor; et quels furent les ancêtres de
ce même Roger. [p. 298]
CHAP. XXXVI. Relation du mariage de la comtesse Gunnor avec
er
Richard I , duc de Normandie. [p. 300]
CHAP. XXXVII. Comment la comtesse Gunnor donna ses sœurs et ses
nièces en mariage aux plus nobles seigneurs de Normandie, et de la
postérité que celles-ci laissèrent après elles. [p. 301]
CHAP. XXXVIII. Comment Etienne, comte de Mortain et neveu du roi
Henri, lui succéda dans son royaume. [p. 304]
CHAP. XXXIX. Comment la comtesse Adèle de Blois prit l’habit de
religieuse, alla demeurer à Marcigny, du temps du seigneur Pierre,
abbé de Cluny, et mourut la seconde année après la mort de Henri,
roi des Anglais, son frère. [p. 306]
CHAP. XL. D’un vent violent qui survint avant la mort du roi Henri; et
d’une foule de grands du royaume d’Angleterre qui moururent
l’année même de la mort de ce roi, ou l’année suivante. [p. 306]
CHAP. XLI. Des fils de Robert, comte de Meulan, et des fils de Henri,
son frère, comte de Warwick. [p. 307]
CHAP. XLII. De la mort du seigneur Boson, abbé du Bec, et de son
successeur. [p. 308]
SUPPLÉMENT à l’Histoire des Normands. [p. 309]
FRAGMENT d’une épitaphe de Guillaume. [p. 317]

GUILLAUME DE POITIERS.
NOTICE sur Guillaume de Poitiers. [p. 321]

VIE DE GUILLAUME-LE-CONQUÉRANT. [p. 325]


*** END OF THE PROJECT GUTENBERG EBOOK HISTOIRE DES
DUCS DE NORMANDIE, SUIVIE DE: VIE DE GUILLAUME LE
CONQUÉRANT ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG
LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
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.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like