The Internet Bookshop Dbdudes, Inc. Computer Scientists: Allen Lee Robert Smith
The Internet Bookshop Dbdudes, Inc. Computer Scientists: Allen Lee Robert Smith
DBDudes, Inc.
Computer Scientists:
Allen Lee
Robert Smith
I. Overview
Our group, DBDudes, consisting of members Robert Smith and Allen Lee,
proposes creating a new Internet bookstore called The Internet BookShop. The purpose
of our website is to create a down to earth environment where Internet users from around
the world can purchase their favorite books.
The following diagrams provide a high-level introduction to our database. They are
provided as reference while learning about the system’s client functionality in the
following section.
Entity-Relationship Diagrams:
Customers
password
username cname
cid address
Customers
Books
author year_published
title qty_in_stock
isbn price
Books
cardmonth cardyear
cardnum
order_date
ordernum ship_date
Orders
Customers
qty
OrderList
Orders Books
We start by going over the types of users on our system. There are two different classes:
1. Anonymous Users
All users who initially connect to our website are in this class and maintain in
it until they log in with an account. They can search for books online, view book
information for specific books, add books to their shopping carts, modify books in
their shopping cart, view help menus, create new user accounts, and login to the
system.
2. Logged in Users
Once users have logged in from a previously created account, they have all the
rights and functionality of an anonymous user as well as the ability to proceed to
the checkout. Once there, they can confirm and then place their order.
We will now examine the experience that each class of user will have during a visit to our
website.
1. Home Page
2. Search Page
3. Book Information Page
4. Account Creation Page
5. Shopping Basket
6. Login Page
7. Help/Information Page
8. F.A.Q.
9. System Rules Page
10. Contact Page
Every page will have a menu bar at the top. This will allow users to move
fluidly around our system from any page. All users, whether logged in or not,
will have access to the same menu bar although some of the web pages may not
be available unless a user has logged in. The menu bar will offer the following
options:
Home
Search Checkout
The home page will be the first page users see when they connect to the
website. Users will be greeted by a welcome message for our web site. They will
also be presented with the following list of options:
Action Directed To
Create new Account Page 4
Login Page 6
The application layer will display the same HTML home page for all users
who connect to the system.
This page will consist of a series of questions that will assist a user in
searching our database. A User selects whether they would like to search for a
Users will be presented with a list of books and have the ability to view individual
books book information pages, Page 3, for each book in the database.
The application layer will load a generic web form as described above.
When the user submits the query, the application layer will call a JSP to
retrieve the requested information from the database as well as present this
information to the user as HTML.
For each book on the website, the server will generate a unique book
information page based on the ISBN number of the book. Users will be presented
with information such as the books title, author, price, and availability.
Based on the quantity of the book currently in stock, the user will receive one
of the following messages about the book’s availability:
http://server.com/bookhome.jsp?ISBN=1232221111
The application layer will also check for invalid, missing, or unknown ISBN
numbers and report to the user if the book they requested cannot be found
on the system.
After the account information has been entered correctly, the account will be
created by the system and the user will be automatically logged in and directed to
their shopping basket, Page 5.
The application layer will check the information the user enters thoroughly
each time they submit it before attempting to create the account. If all the
data passes, the server will attempt to make the account and check for
account creation errors.
In addition, the Account Creation Page will invoke the Login Page’s JSP file
from Page 6 in order to log the user into their account directly after it has
been created.
The shopping basket is a temporary state page that shows the user which items
they have added to their order during their current visit to the website. In
addition, users can change their shopping cart by both modifying the quantities of
books in their baskets, as well as deleting books from their basket. To make
changes to their shopping cart, users will need to click an Update button that will
reload their shopping cart with their new options present.
The application layer will present a form to the user listing each of their
books and the current quantities of each book they wish to order. The form
will allow users to modify these quantities taking care to allow only valid
The login page will ask a user for their username and password to use to log
into the system. In addition, they will have the following options based on the
information they provided:
Action Directed To
Forgot Password E-mail Message to Administrator
Login: Incorrect Information Page 5
Login: Correct Information Back to Page 6
The application layer will query the database with the information the user
has provided and if it is valid for a user in the system, it will log a user in by
creating a cookie on the user’s machine.
Action Directed To
View F.A.Q. Page 8
View Rules Page 9
Display Contact Information Page 10
General Help
On all help pages, the application layer will simply load HTML webpages
for any user requesting the information.
The F.A.Q. Page, or Frequently Asked Questions Page, will inform the user of
common questions many users have about the system or how to use the system as
well as providing a solution to the problem.
Our website will have a page displaying system rules that users, by using our
system, are required to follow.
This page will make available to the user information on how to contact a staff
member via e-mail to help them with any problem they might have.
Only when a user has at least one item in their shopping basket and has logged
into our system will they be able to proceed to the checkout page. First, they will
be asked to confirm the items in their order. Next, they will be asked to provide a
valid credit card for the order as well as shown their shipping address for the
order. Finally, they will be shown the information for their entire order and asked
to confirm it. Once they confirm the order, it is sent to the database for
processing.
Even if quantities of a specific book are not available at the time of purchase,
the transaction will still be completed. If a book’s quantity in stock falls to below
zero, that will represent to the store owners that X number of holds have been
placed on the book, to be filled as soon as new copies of the book arrives.
The application layer will present multiple forms to the user each asking
them a small set of questions including asking them for their credit card
information and whether they would like to confirm their order or not. Each
form will submit to a JSP, which will then generate a new form based on the
results of the previous form. When all the information has been processed
The following tables will be included in our database. Please refer to the E-R diagrams at
the beginning of the document for a higher-level graphical description.
Customers
This table stores all of the information associated with a given user. It is used to
authenticate users attempting to login as well as retrieving shipping information
about user during check out. A user’s cid is used by other tables to track a user’s
orders and movement in our system.
Books
Each entry in this table represents a specific book the store carries. When a user
searches the database for a specific book, this table is consulted for that
information. When a user requests information about a specific book, we present
publishing information including ISBN, title, author, and year as well as our
system information including our price and quantity in stock.
We use ISBN numbers as the primary key because this system is acknowledged
worldwide and no two books ever have the same ISBN number.
This table stores one entry for each order the user places. It only includes general
information about the transaction itself, and not the specific items purchased by
the user. The cid of the user placing the order as well as their credit card number
and credit card date are stored here. In addition, we can track when the order was
submitted as well as when it shipped.
OrderList
This table records the items purchased for each transaction in the Orders table as
well as their associated quantities.
For example, if a user purchased two copies of one book and one copy of another
book, then there would be a single entry in the Orders table and two entries in the
OrderList table. The two copies of the first book would compose the first entry in
the OrderList table while the single copy of the second book would compose the
second entry.
Search Queries
When a user queries the database using our search page, he can search by author,
title, or ISBN number using a specified search string, <SearchString>, and the
results are returned in alphabetical order based on title. This is implemented by one
of the following three queries:
The queries are all so similar that they can be built from the same string with simply
one word, the column to search on, modified. If the <SearchString> is left blank, it
will signify a wildcard search in the database, retrieving all books available. In
addition, text matches will be formatted so that they are case insensitive during a
search.
Information for each book will be retrieved solely based on the ISBN number
provided, <SpecifiedISBN>, and the following query:
Because the ISBN number is a primary key on book, and since we are using an
equality match rather than a LIKE match as we did to search for sets of books, we are
guaranteed that at most one book will be returned by this query.
If so, the user is told to select a new username. The application server compares all
usernames in a case insensitive manner, so that no two usernames formatted with
different cases can be created. After this process is complete, the server creates the
new account using the information provided by the user and the following query:
If there are any database problems during the creation of the account, most likely due
to concurrent access or the server being unavailable, the user is informed and the
creation process is aborted.
Shopping Basket
For each book in the user’s shopping basket, the system will retrieve its ISBN
number, title, and price and display it to the user:
As with the query used for the book information page, we are guaranteed at most one
result per query.
Login Page
The login page takes a given username and searches for a matching record in the
Customers table using the following query:
Again, the username is formatted so that the match is case insensitive. If an account
is found matching the <SpecifiedUsername>, the password is then examined and
checked against the one provided by the user. Unlike username checks, password
checks are case sensitive.
Page 1 – Verify Order: As with the shopping basket page, the system retrieves the
ISBN number, title, and price for each book in the user’s shopping basket and
displays it to the user:
Page 2 – Verify Shipping Information: Using the login cookie created at the time of
login, the system retrieves the user’s <Cid> and then queries the database using this
primary key to retrieve the user’s shipping address.
Page 3 – Confirm Order: On the final page before submitting the user’s order, we
present their shopping basket one last time using and use the following query to
retrieve information on each book the user is ordering:
Page 4 – Submit Order: Once all the information has been verified, we begin
processing the transaction. If there are any errors during any point in the transaction,
we rollback the entire transaction and inform the user of an error.
The first step is to create a single unique entry in the Orders table:
Afterwards, we need to query the database to retrieve the new order number created
by the previous SQL statement:
SELECT ordernum
FROM Orders
WHERE CID = <Cid>
ORDER BY ordernum DESC
Finally, for each unique book in the transaction, we add an entry into the OrderList
table containing the order information, book information, and number of quantities
ordered.
INSERT INTO OrderList (ordernum,isbn,qty)
VALUES (<OrderNumber>,<ISBN>,<cid>)