100% found this document useful (11 votes)
20 views

Download ebooks file (Ebook) Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle by Dave Wolf,A.J. Henley (auth.) ISBN 9781484231944, 9781484231951, 1484231945, 1484231953 all chapters

The document provides information about the ebook 'Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle' by Dave Wolf and A.J. Henley. It includes details about the book's content, chapters, and authors, as well as links to download the ebook and other related titles. The book covers various topics essential for building web applications using Java EE technologies.

Uploaded by

negarhealer26
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (11 votes)
20 views

Download ebooks file (Ebook) Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle by Dave Wolf,A.J. Henley (auth.) ISBN 9781484231944, 9781484231951, 1484231945, 1484231953 all chapters

The document provides information about the ebook 'Java EE Web Application Primer: Building Bullhorn: A Messaging App with JSP, Servlets, JavaScript, Bootstrap and Oracle' by Dave Wolf and A.J. Henley. It includes details about the book's content, chapters, and authors, as well as links to download the ebook and other related titles. The book covers various topics essential for building web applications using Java EE technologies.

Uploaded by

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

Download Full Version ebook - Visit ebooknice.

com

(Ebook) Java EE Web Application Primer: Building


Bullhorn: A Messaging App with JSP, Servlets,
JavaScript, Bootstrap and Oracle by Dave Wolf,A.J.
Henley (auth.) ISBN 9781484231944, 9781484231951,
1484231945, 1484231953
https://ebooknice.com/product/java-ee-web-application-
primer-building-bullhorn-a-messaging-app-with-jsp-servlets-
javascript-bootstrap-and-oracle-6840556

Click the button below to download

DOWLOAD EBOOK

Discover More Ebook - Explore Now at ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason;


Viles, James ISBN 9781459699816, 9781743365571,
9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374

ebooknice.com

(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena


Alfredsson, Hans Heikne, Sanna Bodemyr ISBN 9789127456600,
9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312

ebooknice.com

(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT


II Success) by Peterson's ISBN 9780768906677, 0768906679

https://ebooknice.com/product/sat-ii-success-
math-1c-and-2c-2002-peterson-s-sat-ii-success-1722018

ebooknice.com

(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master


the SAT Subject Test: Math Levels 1 & 2) by Arco ISBN
9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-
arco-master-the-sat-subject-test-math-levels-1-2-2326094

ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C -
Depth Study: the United States, 1919-41 2nd Edition by
Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044

ebooknice.com

(Ebook) Java for the Web with Servlets, JSP, and EJB: A
Developer's Guide to J2EE Solutions by Budi Kurniawan ISBN
9780735711952, 073571195X
https://ebooknice.com/product/java-for-the-web-with-servlets-jsp-and-
ejb-a-developer-s-guide-to-j2ee-solutions-978614

ebooknice.com

(Ebook) Building RESTful Web Services with Java EE 8:


Create modern RESTful web services with the Java EE 8 API
by Mario-Leander Reimer ISBN 9781789532883, 1789532884
https://ebooknice.com/product/building-restful-web-services-with-java-
ee-8-create-modern-restful-web-services-with-the-java-
ee-8-api-10416642
ebooknice.com

(Ebook) XML, XSLT, Java, and JSP: A Case Study in


Developing a Web Application by Rockwell, Westy ISBN
9780735710894, 0735710899
https://ebooknice.com/product/xml-xslt-java-and-jsp-a-case-study-in-
developing-a-web-application-5399182

ebooknice.com

(Ebook) Murach’s Java Servlets and JSP by Joel Murach,


Michael Urban ISBN 9781890774783, 1890774782

https://ebooknice.com/product/murachs-java-servlets-and-jsp-5903424

ebooknice.com
Java EE Web
Application
Primer
Building Bullhorn: A Messaging
App with JSP, Servlets, JavaScript,
Bootstrap and Oracle

Dave Wolf
A.J. Henley
Java EE Web
Application Primer
Building Bullhorn: A Messaging
App with JSP, Servlets,
JavaScript, Bootstrap and
Oracle

Dave Wolf
A.J. Henley
Java EE Web Application Primer: Building Bullhorn: A Messaging App
with JSP, Servlets, JavaScript, Bootstrap and Oracle

Dave Wolf A.J. Henley


New York, USA Washington, D.C., District of Columbia, USA

ISBN-13 (pbk): 978-1-4842-3194-4 ISBN-13 (electronic): 978-1-4842-3195-1


https://doi.org/10.1007/978-1-4842-3195-1
Library of Congress Control Number: 2017962002
Copyright © 2017 by Dave Wolf, A.J. Henley
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.
Cover image by Freepik (www.freepik.com)
Managing Director: Welmoed Spahr
Editorial Director: Todd Green
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Technical Reviewer: Manuel Jordan Elera
Coordinating Editor: Mark Powers
Copy Editor: April Rondeau
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505,
email [email protected], 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 email [email protected], or visit http://www.apress.
com/rights-permissions.
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/9781484231944.
For more detailed information, please visit http://www.apress.com/source-code.
Printed on acid-free paper
To those who seek to teach themselves.
Table of Contents
About the Authors��������������������������������������������������������������������������������ix
About the Technical Reviewer�������������������������������������������������������������xi
Introduction���������������������������������������������������������������������������������������xiii

Chapter 1: Getting Started��������������������������������������������������������������������1


The Oracle Virtual Machine�����������������������������������������������������������������������������������2

Chapter 2: What Is a Database?�����������������������������������������������������������5


Referential Integrity����������������������������������������������������������������������������������������������6
Null Values������������������������������������������������������������������������������������������������������������6
Primary Keys, Foreign Keys, and Indexes�������������������������������������������������������������7
Joining Tables�������������������������������������������������������������������������������������������������������7
Normalization��������������������������������������������������������������������������������������������������������8
Structured Query Language (SQL)������������������������������������������������������������������������8
Working with the Oracle Database������������������������������������������������������������������������9
How to Open and Use SQL Developer�����������������������������������������������������������������10

Chapter 3: Installing and Running Eclipse������������������������������������������11

Chapter 4: Bullhorn Site Overview������������������������������������������������������15


The Components of Bullhorn�������������������������������������������������������������������������������15
What Does Each Page Look Like?�����������������������������������������������������������������������17
Editing a Profile ��������������������������������������������������������������������������������������������������21

v
Table of Contents

Chapter 5: What Is MVC?��������������������������������������������������������������������23


The Model, View, Controller, and Service in Bullhorn������������������������������������������24

Chapter 6: Creating a Web Application�����������������������������������������������27

Chapter 7: The DAO/Repository����������������������������������������������������������31


Implement Java Persistence (JPA)����������������������������������������������������������������������34
The Persistence.xml File�������������������������������������������������������������������������������������36
The JPA Entities��������������������������������������������������������������������������������������������������38

Chapter 8: The Service Layer��������������������������������������������������������������43


Create a DbUtilities Class������������������������������������������������������������������������������������43
Create the DbUser Class�������������������������������������������������������������������������������������44
Create the DbPost Class��������������������������������������������������������������������������������������51

Chapter 9: The Controller��������������������������������������������������������������������57


What Is a Servlet?�����������������������������������������������������������������������������������������������57
Getting the Form Data into the Servlet���������������������������������������������������������������59
Sending the Data to the Next Page���������������������������������������������������������������������59
How the Servlet Finds the Next Page������������������������������������������������������������������60
How to Set Values on Your Output Page��������������������������������������������������������������60
How the Log Out Button Works���������������������������������������������������������������������������61
The Login Servlet Code���������������������������������������������������������������������������������������61
The News Feed Servlet Code������������������������������������������������������������������������������64
The PostServ Servlet Code����������������������������������������������������������������������������������67
The Profile Servlet Code�������������������������������������������������������������������������������������69
The AddUser Servlet Code����������������������������������������������������������������������������������74

Chapter 10: The Presentation/View����������������������������������������������������77

Chapter 11: Designing Web Pages with HTML������������������������������������79

vi
Table of Contents

Chapter 12: HTML5 Tags���������������������������������������������������������������������81


Explanation of Common Tags������������������������������������������������������������������������������82
HTML Tables��������������������������������������������������������������������������������������������������������85
A Basic HTML5 and JSP Document���������������������������������������������������������������������86
JSP Standard Tag Library (JSTL)�������������������������������������������������������������������������87
What Can You Do with JSTL?������������������������������������������������������������������������������89
Prevent Cross-site Scripting Attacks�������������������������������������������������������������89
Loop Through a Collection�����������������������������������������������������������������������������89
Set a Value�����������������������������������������������������������������������������������������������������90
Test a Condition���������������������������������������������������������������������������������������������90
Repeat Content a Fixed Number of Times�����������������������������������������������������91
Test a Condition and Choose an Alternative��������������������������������������������������91
Determine If a String Is Null or Empty�����������������������������������������������������������92
Formatting Dates�������������������������������������������������������������������������������������������92
How to Display Form Data����������������������������������������������������������������������������������93
Create an HTML Login Form��������������������������������������������������������������������������93
Create a Page to Display the Output of Your Form����������������������������������������95
How to Allow the User to Navigate Between Web Pages�������������������������������96
Reusing JSP Code�����������������������������������������������������������������������������������������������96
Customizing Your Errors��������������������������������������������������������������������������������������97

Chapter 13: The Stateless Nature of the Web�����������������������������������101


The Process of Passing Data����������������������������������������������������������������������������102

Chapter 14: Users and Sessions�������������������������������������������������������105


Adding Objects to the Session��������������������������������������������������������������������������107
To Read a Value from the Session���������������������������������������������������������������108

vii
Table of Contents

Chapter 15: How to Create Database Tables for Bullhorn�����������������109

Chapter 16: Make Web Pages Do Something Using JavaScript��������111


Validate a Form Using JavaScript���������������������������������������������������������������������112
Display Number of Characters in Text Box��������������������������������������������������114

Chapter 17: Cascading Style Sheets (CSS)���������������������������������������115


Span and Div Tags���������������������������������������������������������������������������������������������116

Chapter 18: Making Pages Work on All Screen Sizes�����������������������119


Working with BootStrap������������������������������������������������������������������������������������120

Chapter 19: Use Gravatar to Display User’s Avatars with Posts�������123


Calculating an MD5 Hash with Java�����������������������������������������������������������������124

Chapter 20: The Presentation/View��������������������������������������������������127


The Code for the Login Page�����������������������������������������������������������������������������127
The Code for the Home Page����������������������������������������������������������������������������129
The Code for the News Feed Page��������������������������������������������������������������������130
The Code for the Profile Page���������������������������������������������������������������������������132
The Code for the Add User Page�����������������������������������������������������������������������134
The Code for the Support Page�������������������������������������������������������������������������135
The Code for the Error Page������������������������������������������������������������������������������136
The Navbar Include File������������������������������������������������������������������������������������136
The BootStrap Include File��������������������������������������������������������������������������������139
The Bootstrap Style Pages��������������������������������������������������������������������������140
The Footer Include File��������������������������������������������������������������������������������������140

Index�������������������������������������������������������������������������������������������������141

viii
About the Authors
Dave Wolf is a certified Project Management
Professional (PMP) with over 20 years of
experience as a software developer, analyst,
and trainer. His latest projects include
collaboratively developing training materials
and programming bootcamps for Java and
Python.

A.J. Henley is a technology educator with over


20 years of experience as a developer, designer,
and systems engineer. He is an instructor at
Howard University and Montgomery College.

ix
About the Technical Reviewer
Manuel Jordan Elera is an autodidactic
developer and researcher who enjoys learning
new technologies for his own experiments and
for creating new integrations.
Manuel won the 2010 Springy Award—
Community Champion and Spring Champion
2013. In his little free time, he reads the Bible
and composes music on his guitar. Manuel
is known online as dr_pompeii. He has
tech reviewed numerous books for Apress,
including Pro Spring Messaging (2017), Pro Spring, 4th Edition (2014),
Practical Spring LDAP (2013), Pro JPA 2, Second Edition (2013), and
Pro Spring Security (2013).
Read his 13 detailed tutorials about many Spring technologies or
contact him through his blog at http://www.manueljordanelera.
blogspot.com. You can also follow him on his Twitter account,
­@dr_pompeii.

xi
Introduction
Are you a Java developer wondering how to create an Enterprise
application? Do you find the different components overwhelming or
confusing, not knowing how they go together? We’re here to help. What if
you could just get an example application working and use that knowledge
to continue your Java journey?
This book and the accompanying code will show you one way to
create a website. It’s not the only way. It may not be the best way for
every application. But it’s a way that will introduce you to the different
components of Java Enterprise application development. And it’s a good
way to get started.
In Java EE Web Application Primer, you’ll learn the basics of Java EE
application development. You’ll see how the parts connect. You will have
the Java code for a complete, working application.

The Software
Our students take our courses to learn how to program for large
companies. We have found these are the skills most requested by the
companies hiring our students. We choose to use Java 8, Oracle 12c, and
Eclipse for developing the application. Similarly, we choose to use JPA
(Java Persistence API) instead of Hibernate. We choose JSTL (Java Standard
Tag Library) over other available options. Again, these technologies teach
core skills without hiding all the implementation details from the student.
Our application is designed to teach. We provide the complete source code.

xiii
Introduction

You will learn much simply by reviewing and modifying the source code.
This book answers the questions you may have after working with the
source code, and the source code helps explain how the concepts in this
book have been implemented.

How to Use This Book


We wrote this book based on our experience teaching Java bootcamps and
other programming courses. The objective of our courses is to help people
learn skills they can use at work. Businesses care more about results
than theory, and we apply that principle to our application. This book
answers the questions many of our students have about web application
development when starting out.

What Our Students Have Achieved


“I remember when the light bulbs started going off in my head,
when the gibberish on the screen started to make sense. It was
the most amazing feeling to start catching up with the rest of
my impressive classmates.”
—Vicky, now a project manager at a Fortune 100 company
“I went through four years of university schooling in computer
science, and I can honestly say that going through this course
gave me a wealth of experience that I only had a taste of dur-
ing my schooling. I certainly had project experience under my
belt graduating with a tech degree, but doing project after
project with Dave and Alton, the instructors, really cemented
the theory and practices I had learned previously in stone.
More than that, I got to patch up a lot of holes that I had left
unfilled from missed opportunities in college.”
—Francis, now an analyst at a Fortune 100 company

xiv
Introduction

If you’re ready to get started and develop your first Java Enterprise web
application, we thank you for choosing our book to begin your journey.
Know that you will face challenges and frustrations. You aren’t alone. We
have found that as our students worked through those, they learned more
about software development than we could ever teach in a book. You’re in
the right place. Wait no longer. It’s time to move on to Chapter 1!

xv
CHAPTER 1

Getting Started
VirtualBox allows you to create virtual computers within your physical
computer, enabling you to run multiple computers on one system. Setting
up VirtualBox requires very few steps. Once installed, you can then import
an existing virtual computer and begin work using that system.
Click and run the file to install VirtualBox just like with any other
software you’ve ever downloaded. If you are using Windows, double-click
the setup file and follow the prompts to install. If you are using a Mac, open
the DMG file that you downloaded and drag the VirtualBox file to your
Applications folder. During the installation, keep all of the options set to
their default.
Start the VirtualBox program. VirtualBox allows you to manage
your various virtual machines and easily create new ones. You can run
VirtualBox directly from the installation program, or you can start it from
the desktop icon.

Note Download VirtualBox from Oracle’s website:


http://www.oracle.com/technetwork/server-storage/
virtualbox/downloads/index.html

© Dave Wolf, A.J. Henley 2017 1


D. Wolf and A.J. Henley, Java EE Web Application Primer,
https://doi.org/10.1007/978-1-4842-3195-1_1
Chapter 1 Getting Started

The Oracle Virtual Machine


Being lazy—I mean, efficient—we used a pre-built Oracle virtual
machine (VM) image to develop the site. Oracle makes this VM available
for download at no cost (registration required). The VM requires the
open source VirtualBox software be installed on your computer as just
described. The VM hosts the latest version of the Oracle database (version
12c). It also contains SQL Developer and even Java 1.8. You will only need
to install Eclipse, which we’ll cover in a later section.

Tip Download the Oracle Database Application Developer virtual


machine from the Oracle website at http://www.oracle.
com/technetwork/database/enterprise-edition/
databaseappdev-vm-161299.html. You must accept the terms of
the software prior to downloading.

Once you have the Oracle virtual machine file ready, select File ➤
Import Appliance in the menu bar. Click the Open Appliance button to
select the Oracle virtual machine file. Navigate to the file with the .ova
file extension. Selecting this file will open a dialog box in VirtualBox that
displays the settings. You can select the Import button from here. The next
window will show you the configuration of the current virtual appliance.
Once you click on Import, VirtualBox will copy the disk images and
create a virtual machine with the settings described in the dialog. You will
see the Oracle virtual machine in the VirtualBox Manager’s list of virtual
machines. The VirtualBox Manager is the first screen that opens when you
open VirtualBox. Select your machine, click Start, and give it time to load,
then you can work with that machine as if it were a separate computer.

2
Chapter 1 Getting Started

Note If you’re not using the Oracle virtual machine, you can
complete everything in this book using Windows.
You can download and install Oracle database version 12c for
Windows at http://www.oracle.com/technetwork/database/
enterprise-edition/downloads/database12c-win64-­
download-2297732.html.
You will also need to install SQL Developer, which you can find at
http://www.oracle.com/technetwork/developer-tools/
sql-developer/downloads/index.html.
Finally, you will need to install Eclipse Oxygen from http://www.
eclipse.org/downloads.

3
CHAPTER 2

What Is a Database?
A database is a place to permanently store data for retrieval in a safe,
efficient way. A database allows us to create data and save it permanently.
It allows us to retrieve previously created data, update existing data, or
delete existing data.
A transaction groups SQL statements so that they are all applied to
the database. If one statement fails for some reason, all the statements
are undone from the database. Transactions ensure data integrity.
Transactions distinguish a database management system such as Oracle
from a file system.
The properties of a database transaction that ensure data validity are
atomicity, consistency, isolation, and durability.

• Atomicity refers to the fact that in each database


transaction either all the information is saved or none
of the information is saved.

• Consistency ensures that a transaction either works


correctly or the dataset is returned to the state it was in
before the transaction was executed.

• Isolation refers to the ability of a database to keep a


transaction that is not yet committed distinctly separate
from the working database.

© Dave Wolf, A.J. Henley 2017 5


D. Wolf and A.J. Henley, Java EE Web Application Primer,
https://doi.org/10.1007/978-1-4842-3195-1_2
Chapter 2 What Is a Database?

• Durability refers to the way committed data is saved by


the system such that, even in the event of a failure and
system restart, the data is available in its correct state.

The database stores data in sets, which are most commonly viewed as
tables. One row of a database table represents a record containing related
attributes, called fields. Fields are represented by the columns in a table.

Referential Integrity
Your database management system (DBMS) supports referential integrity.
The goal of referential integrity is to avoid having “orphaned” data.
Orphaned data can happen when you are deleting or updating the data
in your tables; for example, if you have a post in your database that does
not have a matching user. This shouldn’t happen and is often the result
of importing poorly formatted data or inadvertently deleting a user. A
database management system such as Oracle can enforce referential
integrity to prevent this by denying changes that will result in orphaned
data.

Null Values
Sometimes there is no value in a column of a row. In this case, the column
stores a NULL value. You can think of this as a flag to indicate the absence
of data. NULL is different from the numeric value zero or a string with a
length of zero characters. It is neither. It is nothing, because no value has
been stored in the column for this record. NULL, it turns out, is very useful.
You can search for a field in records that contain NULL and know that they
are the ones with no value in the field.

6
Chapter 2 What Is a Database?

Primary Keys, Foreign Keys, and Indexes


Databases are very powerful tools that allow us to search and sort data at
incredible speeds. An essential ingredient of the mechanics of a database
is that each record should be unique. To make each record unique, either
use an existing field that is unique to each record or add a field to each
record that contains a unique number.
Your DBMS can generate a unique number for each record. The
unique number of each record becomes its primary key. This field
distinguishes that record from any other in the table.
When a second table contains data related to that of the first table, the
second table can refer to the original using the primary key field.
A primary key used as a reference in another table is called a foreign
key. Foreign keys define a reference from one table (the child) to another
table (the parent).
To make access to a column of data more efficient, the database will
create an object called an index. An index contains an entry for each value
in the indexed column(s), resulting in fast access to rows. Like an index
in a print book, the database can look up the requested value in the index
and quickly locate its corresponding row in the table.

Joining Tables
Relationships are a means to join data to different tables. This helps you
avoid redundancy in the tables. You can divide your data into different
tables—entering it only once—and then reference it from other tables by
establishing relationships.

7
Chapter 2 What Is a Database?

There are three types of relationships, as follows:

• A One-to-One relationship is where each record in the


first table has only one matching record in the second
table. This usually happens when information in one table
is divided across multiple tables. This is not common.

• A One-to-Many relationship is where each record in the


first table matches with multiple records in the second
table. For example, a user can have multiple posts.

• A Many-to-Many relationship is where each record


in the first table can have many corresponding
records in the second table, and also each record
in the second table can have many corresponding
records in the first table.

Normalization
In a normalized data structure, each table contains information about a
single entity and each piece of information is stored in exactly one place.
Normalization is the process of efficiently organizing data in a
database. This is done by organizing the columns (fields or attributes) and
tables of a relational database to minimize data redundancy.
The goals of the normalization process are to eliminate redundant data
and ensure data dependencies make sense.

Structured Query Language (SQL)


A database has its own programming language, SQL (Structured Query
Language). SQL is a nonprocedural language that provides database
access. All database operations are performed using SQL. Java can talk
to the database management system using SQL. This is done using the

8
Chapter 2 What Is a Database?

JDBC API, which allows your application to specify which records to


retrieve based on various criteria. For example, you can select records
created between certain dates or update only records that meet given
criteria. SQL can also be used to create database objects, such as user
tables and saved queries, which are known as views. A view contains
no data itself but is simply the stored query the use of which simplifies
accessing the data.
SQL (pronounced as the letters S-Q-L or sequel) is a specialized
database language that consists of statements that are very close to
English. SQL has one purpose: to communicate with a database. We
communicate with the database to add, update, or delete data. We also
communicate with the database to create and modify tables and other
database objects.
Almost every major DBMS supports SQL. Learning SQL will enable
you to interact with almost every database you might encounter. SQL is
easy to learn. The statements consist of descriptive English words. SQL
is powerful. Cleverly using the language elements allows you to perform
complex database operations. SQL is a standard governed by ANSI
(American National Standards Institute). In addition to the standard
implementation of SQL, most vendors implement their own proprietary
extensions. The version of SQL) you use for Oracle may differ from the
version you use to access other databases.

Working with the Oracle Database


Just as you use an IDE (integrated development environment) to work with
Java programs, you can also use an IDE to work with Oracle databases.
This IDE is called SQL Developer. The virtual machine has a copy of SQL
Developer already installed.

9
Chapter 2 What Is a Database?

How to Open and Use SQL Developer


To open SQL Developer in the virtual machine, simply click its icon on the
desktop.

Tip Oracle provides step-by-step instructions for using SQL


Developer on their technetwork website. If you use the virtual
machine, then everything is installed for you. Browse to http://
www.oracle.com/webfolder/technetwork/tutorials/obe/
db/sqldev/r40/sqldev4.0_GS/sqldev4.0_GS.html.

10
CHAPTER 3

Installing and
Running Eclipse
Your virtual machine contains all the software you need to create
Bullhorn—the Oracle Database 12c, SQL Developer, and Java 1.8—but it
doesn’t contain the Eclipse IDE. You will need to download and install that
yourself. Fortunately, the installation process is very easy.

INSTALL ECLIPSE ON THE VIRTUAL MACHINE

To install Eclipse on the virtual machine, you will need to open Firefox and
download the Eclipse archive. Then, you will need to extract the files from the
archive. Next, you will need to run the setup program that is included in the
archive files. Finally, open Eclipse.

1. From the virtual machine, open the Firefox web browser. You
can get to Firefox by clicking on the Applications menu and
selecting the icon for Firefox Web Browser.

2. Next, browse to http://www.eclipse.org/downloads.


3. Click on the orange button to download Eclipse. You’ll be
installing the latest version, which is called Oxygen.
4. You’ll be directed to another page with an orange Download
button. Click this one as well.

© Dave Wolf, A.J. Henley 2017 11


D. Wolf and A.J. Henley, Java EE Web Application Primer,
https://doi.org/10.1007/978-1-4842-3195-1_3
Chapter 3 Installing and Running Eclipse

5. Select the option to open with the Archive Manager when this
window is displayed. The Archive Manager is the program that
will extract your files.

6. You’ll be prompted to select a folder into which you want to


place the extracted files. Browse to the Home folder and select
Extract.

7. Check the option to open the folder to view the files.


Once you see the extracted files, look for the file called
eclipse-­install.

8. Select the option to install Eclipse for Java EE.

9. Your folder should be /home/oracle/eclipse/


jee-­oxygen.

10. Click Launch.

11. Accept the default workspace. This is where your project files
will be kept.

You have just installed Eclipse Oxygen.

HOW TO CHANGE THE PORT IN TOMCAT

By default, Tomcat is configured to listen on the following port numbers: 8005,


8080, and 8009. The port we’re most interested in is 8080 since it’s used for
HTTP access. When you run a web application in Eclipse using Tomcat, the
URL becomes http://localhost:8080/ApplicationName. However,
sometimes these ports are used by other software running on the computer.
Fortunately, Eclipse makes it easy to change the port numbers.

12
Chapter 3 Installing and Running Eclipse

1. From your web project, in the Servers view, double-click on the


server name.

2. That will open a configuration page for Tomcat as follows:

3. Notice that the port numbers are shown in the table on the
right. Click to edit; for example:

4. Once you change the port number for HTTP from 8080 to 9000,
you should press Ctrl + S to save the change and restart the
server.

Your application should now run without conflict. If you do get a conflict, then
you’ve chosen another used port. Repeat the process with a different port
number. It’s best to select a port within the range of 1025 to 65535. You can
research “Well-known port numbers” to find many articles explaining the
reasoning here.

13
CHAPTER 4

Bullhorn Site Overview


The diagram in Figure 4-1 illustrates how the site fits together. Only the
core components are shown. You may wish to add additional pages and
classes as needed.

JPA (data
access)
Classes
Bullhorn Overview Diagram
Session - visible to all servlets and JSPs
Session times out 20 minutes after last accessed
Database
User object in session is available to all servlets and JSPs Posts Table
Users Table
Newsfeed
Login Servlet Home Servlet
Servlet

Request Request Request Request


Request Request
Login Page Home Page Newsfeed Profile

Posts user email


user email Post item
password
Post item
...................
post text Post item motto
Login Post item
Submit Update

Session holds objects (but only if Servlet adds them)


JSP (Java Server Page) = HTML + Java Code (and maybe JavaScript)
Servlet = Java code which create objects such as the User
Class = Java code used as a blueprint for an objects Note: Not all classes
For simplicity, all passwords are the word ‘password’ are shown in this diagram

Figure 4-1. The components that make up Bullhorn

The Components of Bullhorn


• Servlets Java classes that extend the web server to
provide an interface to the browser and database or
other servlets.

© Dave Wolf, A.J. Henley 2017 15


D. Wolf and A.J. Henley, Java EE Web Application Primer,
https://doi.org/10.1007/978-1-4842-3195-1_4
Chapter 4 Bullhorn Site Overview

• JPA classes Java Persistence API classes that are used


to communicate between the servlets and the database.

• Request objects represent information sent between


the browser and the servlets. This information might
include email addresses and passwords that are being
used by the servlet to allow access to the site.

• Sessions are the web server’s method or approach of


retaining data while the user is accessing the site.

• User objects The user information is stored in a class


that will be stored in the session and is available to all
pages for the current user.

• JSP (Java Server Pages) Web pages that contain HTML


and tags from the JSP Standard Tag Library to add
functionality. Because they contain code they can
dynamically render for each user’s request. The JSP
Standard Tag Library permits each person to view their
own version of the page.

• HTML (Hypertext Markup Language) pages. HTML is a


system for tagging text files to control fonts, colors, and
images on your web pages.

Tip To keep your HTML from getting too complicated, use CSS
(Cascading Style Sheets) and JavaScript to control the presentation of
your content and let HTML control the layout.

The Bullhorn application contains web pages for login, home, news
feed, and user profile. The user starts at the login page. Once the user
clicks the Login button, the request (data from the login form) will be sent
to the login servlet.

16
Chapter 4 Bullhorn Site Overview

The login servlet will validate the user against the database. A
valid user will be stored in the session, which is the website’s way of
remembering data between page views. Invalid users will not get past the
login page until they enter a correct username and password combination.
We will create other objects (classes) to validate data or support the
classes and pages shown in the diagram.

What Does Each Page Look Like?


The login page will contain text boxes in which the user will enter their
email and password. This information will be verified in the login servlet. If
they match what is in the database then the user will be redirected to their
home page. If they do not match then the user will be prompted to log in
again. Users who reach the login page but aren’t registered on the site can
register for a login by clicking on the “Join” link. See Figure 4-2.

Figure 4-2. The login page contains text boxes for email and
password and a button to sign in to the application

17
Chapter 4 Bullhorn Site Overview

The home page will allow each user to create a new post. Each post is
limited to 141 characters, so the home page enforces this restriction (see
Figure 4-3). Once the user is logged in, all pages contain a navigation bar at
the top that allows the user to navigate to different pages, view or edit their
profile, and search for posts containing a specific word.

Figure 4-3. The home page contains a form to submit a post to the
database. The form contains a text box and buttons to either submit
the post or clear the form.

Each page contains the same navigation bar, which allows the user
to move around the application. The navigation bar contains the logo,
links for the home page and the news feed page, and a search box. It also
displays the name of the logged-in user. The user can also select from
various user options, which is implemented as a drop-down list. These
include logging out, viewing or editing profile, and submitting feedback.
See Figure 4-4.

18
Exploring the Variety of Random
Documents with Different Content
ágyukon, forognak és nyögnek, mint akik egy végtelen, álmatlan
éjszaka végét várják. Álomport vettek be és mégse tudnak aludni.
Akik pedig idejönnek, ezekhez az ágyakhoz, önkéntelenül valami
szemrehányásnak akarják elejét venni, tompítják a taglejtésüket,
szerények és szemérmesek, apró gombolyaggá szeretnének
összezsugorodni, sün módjára. Érzik, hogy tolakodók. Azzal, hogy
jönnek és azzal, hogy élnek. Beszélni nem igen tudnak. Csak nézik a
drága, kedves embert, aki meg akart előlük szökni – egy mellékajtón
– és az is néz rájuk kissé dacosan és kissé a rajtakapott gyermek
pironkodásával, aki valami tilosat és értékeset tört össze, ami nekünk
kedves. Bámulják a kalapunkat, mely ittmaradt volna nélkülük és
nem tudnak elfojtani valami halvány, alig látható mosolyt, mikor
elmenet nyakunk köré csavarjuk vastag gyapjukendőnket, nehogy
megfázzunk a nyirkos levegőn. Ha ismertük őket, akkor – akár
bevalljuk, akár nem – felelősséget érezünk, a tettükért. Talán mi is
okai voltunk, mindnyájan, akik élünk. Hiszen mi alkottuk az életüket,
melyről lemondtak. Az ő életük a mi életünkből rakódott össze.
Egykor talán egy taglejtést tettünk, mely csüggesztette és
elszomoritotta őket, vagy csak felsóhajtottunk, csunyán és
magunkból kikelve. A tele pohárban oly sok egy utolsó csöpp, annyi,
mint egy óceán. Ezért vezeklünk mindnyájan. Nem vagyunk jók,
vagy irgalmasak, szükségünk van, hogy itt legyünk. Dadogva
meghívjuk őket az élet vendégségére, melyről távozni készültek,
maradjanak még közöttünk, legalább virradtig, aztán menjenek el,
velünk együtt. Hiszen mi is elmegyünk. Nem sokat igérhetünk. Csak
szerény asztalunk van, nekünk is, édes és keserü szerepel
életsorunkon, de tudjuk, hogy jó a lépesméz és kedves a hegedüszó
meg az áprilisi eső. Lesütött fejjel állunk s várjuk, elfogadják-e
szerény ajánlatunkat, bűnbánó meghívásunkat?
Nem tudom, megértenek-e bennünket, mert mi az agyunk és
szívünk megpattanó erőfeszitésével – minden lélektani tudásával és
minden szeretetével – sem tudjuk megérteni őket. Csak azt az
embert érteném meg, aki elkészül erre a tettre. Ez szabadságot
jelent. Ha a zsebében állandóan egy forgópisztolyt, vagy egy gramm
morfiumot tart, akkor megszerezte magának a jóérzést, hogy
bármely pillanatban elhagyhatja tömlöcét, melybe be van zárva, a
kivezető ut az övé, a börtönkulcs nála van.
Vissza-visszafutok ehhez a gondolathoz és megállapodom egy
versnél. Sophokles-nek, a sötét költőnek két sorát mondogatom
magamban, amit még diákkoromban tanultam. A kórházi folyosón
ődöngve – gyötrődő szívvel – megpróbálom magyar szóra tenni a
görög igéket:

Meg se születni, az lenne a legjobb,


Még ifjukorunkban is jó a halál.

Hiába, azóta nem találtak ki nagyobb bölcseséget. Csak a


vasutat, a villanyt, a telefont találtuk ki, mamlaszok, meg néhány
szamár bölcseleti rendszert. De az optimista bölcsek is aláírnák –
szegények – ezt a két sort. Valami cudar antik isten használja az
embereket, akik ugy égnek a szájában, mint a szivarok, s idő után
elveti őket, akárcsak az elhamvadt szivarcsutkákat. Koporsónk ennek
a kegyetlen istennek a hamutárcája, – ne áltassuk magunkat –
semmivel se több, csak a hamutárcája.
Mi pedig semmit se tudunk rendbehozni, kiegyenliteni és
elsimítani. Annyi vágy, ösztön, forrongó salak van bennünk, hogy
nem birunk vele. Robbanó palackok, röpülő lángok vagyunk
mindnyájan. Csak egyetlen tiszta vágyunk marad, hogy meglássuk
ezt az igazságot és megutáljuk, hogy sárnak születtünk.
Ugy fáj ez, hogy itt az udvaron egy fához kell dőlnöm és hirtelen
elsápadok, mint aki hányni akar.

TEMETŐK.
ult délután a villamos egy hosszu, alacsony fal
mellett szaladt el, mely mögül – alattomosan –
ciprusok és márványtömbök kandikáltak. Hevesen
verni kezdett a szívem. A halottak az élők vis-á-
visjai? Itt vannak közöttünk, szemben ezzel a
kerttel? Beépitkeznek a város szívébe?
Kétségbeejtően világitott a gondolat. Alapjában pedig nem is volt
jogom csodálkozásra.
*
A csecsemő, mielőtt elszenderül, sír, mert fél az álmosság okozta
agyvérszegénységtől. Mi tapasztalt felnőttek mosolygunk ezen. Azt
hiszem, hogy a halottak is igy szánakoznak rajtunk, hogy jajgatunk,
mielőtt elaludnánk örökre. Számukra nevetséges ez az idioszinkrázia.
Ők tudják, hogy jó aludni, s mikor éjjel látják kigyulladt szemeinket,
sopánkodva mondják: „Még mindig ébren vannak, virrasztanak
szegények. Látom, világos az ablakuk.“
*
Szeretem a temetőket. Egyszerüen és közönségesen szeretem a
színeit, az őszi okkersárgáját, a haragoszöld árnyalatait, a csendjét,
mely ugy veszi körül, mint néma zivatar. A festők szeretik igy a
tengert. Csak a ragyogását látják, a hullámzó vonalait, melyek
mögött mélységek lappanganak. Ezt a táncoló és csillogó felszínt
szeretem, csüggedten és regényesen, a sírjait, lámpáit a ködben, a
viaszgyertyák olcsó füstjét, a címereket, melyek családi kripták
homlokán komorkodnak. Cifraság mindenütt. A kövér talaj, mely
hullákon hízott meg és a virágok és az arany délutánok csak a szívek
szerelméről beszélnek. A termékeny ellentétet bámulom itten.
Ábrándosan szeretem a temetőket, mint kiscseléd a konyha piros
papirjait, mint sápkóros leány az esküvőket és a színházat.
*
Mikor megkezdődik az élők végtelen körmenete a halottakhoz,
bámulok azon, hogy ők, akik legtöbben vannak, akik a legnagyobb
népet és hadsereget alkotják, a világ igazi nagyhatalma, a mi
háromszázhatvanöt napunkból évente csak egyetlen egyet
követelnek maguknak. A kínai halottak jóval szigorubbak. „Kinában –
olvasom egy utirajzban – a halál annyi helyet foglal el, mint az élet.
Mihelyt elhunyt valaki, fontos és gyanus személyiséggé válik, –
bizonyos ártalmas pártfogóvá, – aki haragos és durcás, valaki, aki
jelen van, s akit ki kell engesztelni. Élők és halottak közt a kötelékek
korántsem oldódnak el, a szertartások folytatódnak és állandósulnak.
Szüntelen el-elzarándokolnak a családi sírhoz, tömjént égetnek,
tarackot durrogatnak, rizst és malacot visznek a halottaknak, leadják
náluk a névjegyüket egy papirlap alakjában, melyet kaviccsal
nyomtatnak le.“ Mi sokkal feledékenyebbek vagyunk. Elfelejtjük,
hogy még mindég hagytak nálunk annyi eleven-erőt, mely a föld
összes dinamógépeit elindithatná. Itt terjeng közöttünk a hatásuk,
beszívjuk a tüdőnkbe, táplálja a vérünket. A toll, mivel írunk, a papir,
mire írunk, a lámpa, minél írunk, mind-mind az övék, az ő
találmányuk és tulajdonuk, csak kölcsön kaptuk tőlük rövid
használatra.
*
A temető érzékeny. Mélyebben, elevenebben él, mint bármi. Ha
letépem egy virágát, összeborzong és feljajdul. A suttogás, ami a
mezőn meg se hallik, kiáltássá dagad. Ezer és ezer hajszálgyökér
bogozódik minden tárgy köré, életek legombolyódott fonalai, vágyak
és letört akaratok, melyek még kinyulnak a sírból és követelik
jogaikat. Kikötő van itt. Minden sír egy kis öböl és minden koporsó
ladik, amely a tomboló oceánon átcsapzott szemfedővel vergődött
idáig, és miután leszedte vitorláját, révbe ért. Ez a nyugodalom
csalogatja ide azokat a nagyon magányos sétálókat, akiknek még
halottjuk sincsen, és mégis idejönnek, a sírás roppant és mély
szükségéért. Itt minden sír. Mig itt vagyunk, csak mi sírunk. De mikor
este kiballagunk a kapun, és kattognak a zárak, sírni kezdenek a fák,
a füvek, a keresztek és a márványangyalok, a büszke, feszes
márványangyalok is kezükre engedik szelíd fejüket és ők is sírnak.
Ez az a bezárt könyv, amit még nem ismerek. Az életből az
egyetlen dolog, amit még nem ismerek. Sokszor halhatatlan vágyat
érzek erre és valami unszol itt a temetőkapunál, a küszöbön, hogy
lebocsássam a mérőónt és megmérjem a mélységét.
*
Szeretem a temetőket. Nem, mert valami befejeződik itt. De mert
valami, valami elkezdődik…

VILÁG VÉGE.

egint megjósolták a világ végét s én ezeket írom a


naplómba:
*
Egy üstökös – bozontos vörös zseni – közeledik
felénk, aki nincs tisztában a világmindenség
etikettjével.
*
Annyira haragszanak rá néhányan, hogy már égi varangynak
nevezik.
*
Csak nehány repülőgép szállana föl, mint ahogy hajókról
elindulnak a mentőcsónakok a szerencsétlenség pillanatában, és
elsülyednének a levegőben.
*
Minél tovább gondolkozom rajta, annál kevésbbé találom
félelmesnek. Ha most kiütéses hagymázt kapnék, az borzasztóbb
lenne. Mert az egész nem jelentene többet egy-egy ember számára,
mint a saját halálát. Hiszen halálos ágyunkon mindnyájan azt
érezzük, hogy vége a világnak. Aztán nézetem szerint a halál sohase
jöhetne szelídebb formában. Az a félelem, amit máskor egy ember
visel el, most ezerötszáz millió részre oszlana, ahány ember él a föld
hátán. Talán nem is jutna mindenkinek elegendő adag ebből a
keserü méregből.
*
De az emberiség is megsemmisülne. És azután? Csak emberek
vannak, Péterek, Jánosok, az emberiség csak papirosfogalom.
Péterért, Jánosért kár. Az emberiségért nem kár.
*
A föld pedig tovább rohanna a maga utján. Még csak le se
csavarnák világitó lámpását, a napot. Szikrázó fényben égne tovább
az üres színpad és vége lenne az előadásnak.
*
A pesti ember pedig megkérdi: előadás után melyik kávéházban
találkozunk?
KIS TÖRTÉNELEM

ITT EGY MA ÉLŐ EMBER, KI NEM ÉRT A MAGAS POLITIKÁHOZ ÉS


EGYÉB HASZNOS TUDOMÁNYHOZ, ELMONDJA, MIT LÁTOTT MAGA
KÖRÜL ABBAN A KORBAN, MELYET A HOZZÁÉRTŐK NAGYNAK
TARTOTTAK. –

Az a nap 6
A diák 10
Tébolyult nyár 14
Fecskék 18
Gyűlölet 22
Angyalok és tigrisek 24
Enni és aludni 27
Kis kortársaink 31
Az élet divatja 35
Csontok 40
A halál pilulái 44
Le „Kaiser“ 48
Kalendárium 51
Aranyvonat 54
Kalauznék 56
Soklevelü boglárka 59
És a költő? 63
Legenda egy háborus husvétra 66
Regényes emberek
Székely fi az arany sárkányok közt 72
Rózsaszínhaju trafikos kisasszony 73
Menyasszony a kávéházban 74
Alföldi baka a juniusi füvön 75
A bányász 76
Liliomos katona 78
Kiskáté 80
Emlék 1912 május 23-ról 86

UTAK, NÉPEK, VÁROSOK

ITT A KÖNYV ÍRÓJA UTAZÁSAIRÓL SZÁMOL BE, S MEGRAJZOLJA A


RÉGI VELENCÉT, RÓMÁT, PÁRIST, BELGRÁDOT S A RÉGI
BUDAPESTET ÉS BÉCSET IS, MELY MA MÁR OLY MESSZE VAN TŐLE,
HOGY EGYKOR IDŐSZERŰ FELJEGYZÉSEIT JOGGAL EMLÉKIRATNAK
IS TEKINTHETI. –

„Ricordo di Venezia“ 92
Séta a velencei temetőben 96
Tengerre magyar 98
Az örmény paradicsom 102
Sárga, fojtó délután 107
Római jegyzetek 108
Páris
I. A naiv város 111
II. Morgue 113
III. Baudelaire sírja 116
IV. Autrichien 119
V. Kis párisi gondolatok 121
Elsuhanó régi belga táj 123
Belgrádi képek 125
Lapp atyafiak 131
„Fürdői emlék“ 134
Budapest, a kávéváros 138
Bécs, a verkliváros 142

RÓZSAVÍZ
Ó Í Ő Ó Ó Á Ó Á Ó
ITT A RÓZSAVÍZRŐL, A HÓRÓL, A KARÁCSONYRÓL, A VIRÁGOKRÓL,
A FÖLDI ÉLET ÜNNEPNAPJAIRÓL ÉS CSENDES SZENVEDÉSEIRŐL
SZÓLÓ FELJEGYZÉSEK VANNAK EGYBEGYŰJTVE. –

Naplójegyzet egy havas reggelen 146


Firkák a jégen 148
Pilvax 151
Csengetyű 154
Pesti tavasz 156
Rózsavíz 157
Bútorok az utcán 160
Madár a ház fölött 162
Pesti mulató napfénynél 163
Álom és ólom 166
Toroklob 169

VALLOMÁSOK

ITT A HALÁLRÓL, AZ IFJÚSÁGRÓL, A SZENVEDÉLYRŐL S AZ ÍRÁS


MESTERSÉGÉRŐL VAN SZÓ. –

Nyomdafesték 174
Orvos és halál 184
A mindenható bacillus előtt 189
Sárga kultura 192
Mehmed szultán utja 195
Kutyából szalonna 200
Öngyilkosok 204
Temetők 209
Világ vége 212
*** END OF THE PROJECT GUTENBERG EBOOK TINTA ***

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!

ebooknice.com

You might also like