Vous êtes sur la page 1sur 79


Title Page i
Declaration ii
Certificate iii
Acknowledgement iv
Abstract v
List of Figures vi
List of Tables vi
1 Chapter 1- Introduction 1-4
1.1 Purpose 2
1.2 Scope 2
1.3 Definitions, Acronyms and Abbreviations 3
1.4 Technologies to be used 3
1.5 Overview 4
2 Chapter 2-System Development Lifecycle 5-10
3 Chapter 3-Overall Description 11-13
3.1 Functional Requirement 11
3.2 Non Functional Requirement 11
3.3 Software Interface 11
3.4 Hardware Interface 12
4 Chapter 4-Design 14-23
5 Chapter 5-Implementation 24-56
6 Chapter 6-Screen Layouts 58-70
7 Chapter 7-Conclusion 71-72
Chapter 1
Hotel application system software is a desktop based project for managing
customers records, billings, check in, check out through which the administrator
can update all records of the customers. This desktop management system is
designed and implemented in such a way that taking all customers records in a
more effective way though which paperwork is totally reduced. The software
system is based on deleting, inserting all records.

1.1 Purpose

It is supposed to track the number of customers that lodges in the hotel.

Normally, customers records are kept in a book, but we want to automate it. Enter
customers record, search for customers records when the need arises through
customers name, room number/date or id. Make a database of people at different
level with their rolls and form a hierarchy of them, like which role reports to which
particular role. Decide on the various details of the people and their roles that
would be stored in database.

1.2 Scope

This project can be used in the hotel after adding some more useful modules in the
project for which hotel are providing services. Utmost care and back-up procedures
must be established to ensure 100% successful implementation of the
computerized hotel system. In case of system failure, the organization should be in
a position to process the transaction with another organization or if the worst
comes to the worst, it should be in a position to complete it manually.
1.3 Definitions, Acronyms and Abbreviations

J2EE Stands for JAVA 2 Enterprise Edition. It is a programming

platform included in JAVA Language and is used for developing and
running distributed JAVA Applications.

dat The DAT file type is primarily associated with

'Data'. Can be just about anything: text, graphic, or
general binary data. There is no specific structure for
a .DAT file. You can use an editor like EditPad Pro to look
inside a .DAT file and possible determine its contents
and relationship with a program.

1.4 Technologies to be Used

JAVA JAVA is an Object Oriented Programming Language developed

by Sun Microsystems currently owned by Oracle Corporation. JAVA

programs (Applets and Applications) are able to be run on any machine
that has the JAVA Virtual Machine (JVM) installed. Platform Independent
JAVA is used with sever side applications, such as Web Services,
Servlets, and Enterprise Java Beans.

SWING - Swing is a GUI widget toolkit for Java. It is part of Oracle's Java

Foundation Classes (JFC) an API for providing a graphical user

interface (GUI) for Java programs. Swing was developed to provide a
more sophisticated set of GUI components than the earlier Abstract
Window Toolkit (AWT). Swing provides a native look and feel that
emulates the look and feel of several platforms, and also supports a
pluggable look and feel that allows applications to have a look and feel
unrelated to the underlying platform. It has more powerful and flexible
components than AWT. In addition to familiar components such as
buttons, check boxes and labels, Swing provides several advanced
components such as tabbed panel, scroll panes, trees, tables, and lists.
1.5 Overview
The Software Requirement Specification (SRS) Document consist of
following two parts :

Overall Description : This part will describe the major role of

the system components and interactions.

Specific Requirements : This part will describe the roles and

functions of the actors.
Chapter 2
System Development Lifecycle
The systems development life cycle (SDLC), also referred to as
the application development life-cycle, is a term used in systems
engineering, information systems and software engineering to describe a process
for planning, creating, testing, and deploying an information system. The systems
development life-cycle concept applies to a range of hardware and software
configurations, as a system can be composed of hardware only, software only, or a
combination of both.

A systems development life cycle is composed of a number of clearly

defined and distinct work phases which are used by systems engineers and systems
developers to plan for, design, build, test, and deliver information systems. Like
anything that is manufactured on an assembly line, an SDLC aims to produce high
quality systems that meet or exceed customer expectations, based on customer
requirements, by delivering systems which move through each clearly defined
phase, within scheduled time-frames and cost estimates. Computer systems are
complex and often (especially with the recent rise of service-oriented architecture)
link multiple traditional systems potentially supplied by different software vendors.
To manage this level of complexity, a number of SDLC models or methodologies
have been created, such as "waterfarll"; "spiral"; "Agile software development";
"rapid prototyping"; "incremental"; and "synchronize and stabilize".

SDLC can be described along a spectrum of agile to iterative to sequential. Agile

methodologies, such as XP and Scrum, focus on lightweight processes which allow
for rapid changes (without necessarily following the pattern of SDLC approach)
along the development cycle. Iterative methodologies, such as Rational Unified
Process and dynamic systems development method, focus on limited project scope
and expanding or improving products by multiple iterations. Sequential or big-
design-up-front (BDUF) models, such as waterfall, focus on complete and correct
planning to guide large projects and risks to successful and predictable results.
Other models, such as anamorphic development, tend to focus on a form of
development that is guided by project scope and adaptive iterations of feature

In project management a project can be defined both with a project life

cycle (PLC) and an SDLC, during which slightly different activities occur.
According to Taylor (2004) "the project life cycle encompasses all the activities of
the project, while the systems development life cycle focuses on realizing the
product requirements".

SDLC is used during the development of an IT project, it describes the different

stages involved in the project from the drawing board, through the completion of
the project.


The Prototype Software Development Model is used to develop this desktop

application. Software prototyping refers to the activity of creating
prototypes of software applications, i.e., incomplete versions of the software
program being developed. It is an activity that can occur in software
development and is comparable to prototyping as known from other fields,
such as mechanical engineering or manufacturing. A prototype typically
simulates only a few aspects of, and may be completely different from, the
final product.

The basic idea here is that instead of freezing the requirements before a
design or coding can proceed, a throwaway prototype is built to understand
the requirements. This prototype is developed based on the currently known
requirements. By using this prototype, the client can get an actual feel of
the system, since the interactions with prototype can enable the client to
better understand the requirements of the desired system. Prototyping is an
attractive idea for complicated and large systems for which there is no
manual process or existing system to help determining the requirements. The
prototypes are usually not complete systems and many of the details are not
built in the prototype. The goal is to provide a system with overall

Advantages of Prototype model:

Users are actively involved in the development

Since in this methodology a working model of the system is provided,
the users get a better understanding of the system being developed.

Errors can be detected much earlier.

Quicker user feedback is available leading to better solutions.

Missing functionality can be identified easily

Confusing or difficult functions can be identified Requirements

validation, Quick implementation of, incomplete, but functional,

Disadvantages of Prototype model:

Leads to implementing and then repairing way of building systems.

Practically, this methodology may increase the complexity of the
system as scope of the system may expand beyond original plans.

Incomplete application may cause application not to be used as the

full system was designed Incomplete or inadequate problem analysis.

When to use Prototype model:

Prototype model should be used when the desired system needs to

have a lot of interaction with the end users.
Prototyping ensures that the end users constantly work with the
system and provide a feedback which is incorporated in the prototype
to result in a useable system.
Figure 2.1 : Prototyping Model
Outline of the Prototyping Process

The process of prototyping involves the following steps

1. Identify basic requirements
Determine basic requirements including the input and
output information desired. Details, such as security, can
typically be ignored.
2. Develop Initial Prototype
The initial prototype is developed that includes only user
interfaces. (See Horizontal Prototype, below)

3. Review
The customers, including end-users, examine the
prototype and provide feedback on additions or changes.
4. Revise and Enhance the Prototype
Using the feedback both the specifications and the
prototype can be improved. Negotiation about what is
within the scope of the contract/product may be
necessary. If changes are introduced then a repeat of
steps #3 and #4 may be needed.
Chapter 3
3.1 Functional Requirements

Admin must be able to add Record according to the need.

The saved Record must sustain after the application is closed.

Admin must be able to delete record according to need.

Check in, reservation, billing/checkout easily recorded.

3.2 Non Functional Requirements

Backup functionality for databases

Optimizing the performance of application by room searching.
3.3 Software Interface

For executing the application

JRE 8 or above
Any Operating System

For Application Development

Windows xp or Higher
Netbeans 7.3 or above
jdk 8 or above

Creation of Document

Adobe Reader
Microsoft Word

3.4 Hardware Interface

Processor Pentium P4 or Successor

RAM 512 MB or Higher
Hard Disk Drive 20 GB or More
Optical Disk
Not Required
Network Not Required
Table 3.4 Hardware Requirements
Chapter 4

4.1 Sequence Diagram

Figure 4.1.1 Check In

Figure 4.1.2 Reservation
Figure 4.1.3 Billing
Figure 4.1.4 Logout
4.2 Activity Diagram

Figure 4.2.1 Check in

Figure 4.2.2 Delete Record
Figure 4.2.3 Reservation
Figure4.2.4 Search Room
Figure4.2.5 Billing/Check out
Chapter 5
5.1 Introduction about JAVA
Java is a general-purpose computer programming language that is
concurrent, class-based, object-oriented, and specifically designed to have as
few implementation dependencies as possible. It is intended to let
application developers "write once, run anywhere" (WORA), meaning that
compiled Java code can run on all platforms that support Java without the
need for recompilation. Java applications are typically compiled to bytecode
that can run on any Java virtual machine (JVM) regardless of computer
architecture. As of 2015, Java is one of the most popular programming
languages in use, particularly for client-server web applications, with a
reported 9 million developers. Java was originally developed by James
Gosling at Sun Microsystems (which has since been acquired by Oracle
Corporation) and released in 1995 as a core component of Sun
Microsystems Java platform.

The language derives much of its syntax from C and C++, but it has fewer
low-level facilities than either of them. Writing in the Java programming
language is the primary way to produce code that will be deployed as byte
code in a Java Virtual Machine (JVM); byte code compilers are also
available for other languages, including Ada, JavaScript, Python, and Ruby.
In addition, several languages have been designed to run natively on the
JVM, including Scala, Clojure and Groovy. Java syntax borrows heavily
from C and C++, but object-oriented features are modeled
after Smalltalk and Objective-C.
5.2 JAVA the Platform
One design goal of Java is portability, which means that programs written
for the Java platform must run similarly on any combination of hardware
and operating system with adequate runtime support. This is achieved by
compiling the Java language code to an intermediate representation called
Java bytecode, instead of directly to architecture-specific machine code. Java
bytecode instructions are analogous to machine code, but they are intended
to be executed by a virtual machine (VM) written specifically for the host
hardware. End users commonly use a Java Runtime Environment (JRE)
installed on their own machine for standalone Java applications, or in a web
browser for Java applets.

Standardized libraries provide a generic way to access host-specific features

such as graphics, threading, and networking.

A major benefit of using bytecode is porting. However, the overhead of

interpretation means that interpreted programs almost always run more
slowly than programs compiled to native executables would. Just-in-Time
(JIT) compilers were introduced from an early stage that compiles bytecodes
to machine code during runtime. Java is platform independent. But as Java
virtual machine must convert Java bytecode into machine language which
depends on the operating system being used, it is platform dependent.
A Java virtual machine (JVM) is an abstract computing machine. There are
three notions of the JVM: specification, implementation, and instance. The
specification is a book that formally describes what is required of a JVM
implementation. Having a single specification ensures all implementations
are interoperable. A JVM implementation is a computer program that meets
the requirements of the JVM specification in a compliant and preferably
performant manner. An instance of the JVM is a process that executes a
computer program compiled into Java bytecode.

The Java virtual machine is an abstract (virtual) computer defined by

a specification. This specification omits implementation details that are not
essential to ensure interoperability. For example, the memory layout of run-
time data areas, the garbage-collection algorithm used, and any internal
optimization of the Java virtual machine instructions (their translation into
machine code). The main reason for this omission is to not unnecessarily
constrain implementors. Any Java application can be run only inside some
concrete implementation of the abstract specification of the Java virtual

One of the organizational units of JVM bytecode is a class. A class

loader implementation must be able to recognize and load anything that
conforms to the Java class file format. Any implementation is free to
recognize other binary forms besides class files, but it must recognize class
files. Every Java virtual machine implementation must have a bootstrap
class loader, capable of loading trusted classes. The Java virtual machine
specification doesn't specify how a class loader should locate classes.
The Java Runtime Environment (JRE), also known as Java Runtime,
is part of the Java Development Kit (JDK), a set of programming tools for
developing Java applications. The Java Runtime Environment provides the
minimum requirements for executing a Java application; it consists of the
Java Virtual Machine (JVM), core classes, and supporting files.

The Java Runtime Environment (JRE), complementing the JVM with

a just-in-time (JIT) compiler, converts intermediate bytecode into native
machine code on the fly. An extensive set of libraries are also part of the
Java platform.

Java Runtime Environment is a part of the Java platform. The Java

platform refers to a group of software products from Oracle. The platform is
used to develop and run Java programs. The platform includes the execution
engine (called a Java Virtual Machine) that allows the same Java program
file to run on different operating systems. This is a big advantage.

On the other hand Java applications do require a "Java Runtime

Environment" (JRE), and this installation does depend on the operating
system you are running. This page explains how to install JRE on your
machine and how to run a Java application though the Java runtime.
The Java Development Kit (JDK) is an implementation of either one
of the Java SE, Java EE or Java ME platforms released by Oracle
Corporation in the form of a binary product aimed at Java developers on
Solaris, Linux, Mac OS X or Windows. The JDK includes a private JVM
and a few other resources to finish the recipe to a Java Application. Since the
introduction of the Java platform, it has been by far the most widely used
Software Development Kit (SDK). On 17 November 2006, Sun announced
that it would be released under the GNU General Public License (GPL), thus
making it free software. This happened in large part on 8 May 2007, when
Sun contributed the source code to the OpenJDK

Java developers are initially presented with two JDK tools, java and
javac. Both are run from the command prompt. Java source files are simple
text files saved with an extension of .java. After writing and saving Java
source code, the javac compiler is invoked to create .class files. Once the
.class files are created, the 'java' command can be used to run the java

For developers who wish to work in an integrated development

environment (IDE), a JDK bundled with Netbeans can be downloaded from
the Oracle website. Such IDEs speed up the development process by
introducing point-and-click and drag-and-drop features for creating an
Graphical User Interface (GUI) offers user interaction via some
graphical components. For example our underlying Operating System also
offers GUI via window,frame,Panel, Button, Textfield, TextArea, Listbox,
Combobox, Label, Checkbox etc. These all are known as components. Using
these components we can create an interactive user interface for an

GUI provides result to end user in response to raised events.GUI is

entirely based events. For example clicking over a button, closing a window,
opening a window, typing something in a textarea etc. These activities are
known as events.GUI makes it easier for the end user to use an application.
It also makes them interesting.

The Abstract Window Toolkit (AWT) is Java's original platform-

dependent windowing, graphics, and user-interface widget toolkit. The AWT
is part of the Java Foundation Classes (JFC) the standard API for
providing a graphical user interface (GUI) for a Java program. AWT is also
the GUI toolkit for a number of Java ME profiles. For example, Connected
Device Configuration profiles require Java runtimes on mobile telephones to
support AWT.

As the AWT is a bridge to the underlying native user-interface, its

implementation on a new operating system may involve a lot of work,
especially if it involves any of the AWT GUI widgets, because each of them
requires that its native peers are developed from scratch.`
Java Swing
Swing is a GUI widget toolkit for Java. It is part of Oracle's Java
Foundation Classes (JFC) an API for providing a graphical user interface
(GUI) for Java programs. Swing was developed to provide a more
sophisticated set of GUI components than the earlier Abstract Window
Toolkit (AWT). Swing provides a native look and feel that emulates the look
and feel of several platforms, and also supports a pluggable look and feel
that allows applications to have a look and feel unrelated to the underlying
platform. It has more powerful and flexible components than AWT. In
addition to familiar components such as buttons, check boxes and labels,
Swing provides several advanced components such as tabbed panel, scroll
panes, trees, tables, and lists.

Unlike AWT components, Swing components are not implemented by

platform-specific code. Instead, they are written entirely in Java and
therefore are platform-independent. The term "lightweight" is used to
describe such an element.

Given the programmatic rendering model of the Swing framework,

fine control over the details of rendering of a component is possible. As a
general pattern, the visual representation of a Swing component is a
composition of a standard set of elements, such as a border, inset,
decorations, and other properties. Typically, users will programmatically
customize a standard Swing component (such as a JTable) by assigning
specific borders, colors, backgrounds, opacities, etc.
Relationship to AWT
Since early versions of Java, a portion of the Abstract Window Toolkit
(AWT) has provided platform-independent APIs for user interface
components. In AWT, each component is rendered and controlled by a native
peer component specific to the underlying windowing system. By contrast,
Swing components are often described as lightweight because they do not
require allocation of native resources in the operating system's windowing
toolkit. The AWT components are referred to as heavyweight components.

Much of the Swing API is generally a complementary extension of the

AWT rather than a direct replacement. In fact, every Swing lightweight
interface ultimately exists within an AWT heavyweight component because
all of the top-level components in Swing (JApplet, JDialog, JFrame, and
JWindow) extend an AWT top-level container.
Event Handling

What is an Event?

Change in the state of an object is known as event i.e. event

describes the change in state of source. Events are generated as
result of user interaction with the graphical user interface
components. For example, clicking on a button, moving the mouse,
entering a character through keyboard,selecting an item from list,
scrolling the page are the activities that causes an event to happen.

Types of Event

The events can be broadly classified into two categories:

Foreground Events - Those events which require the direct

interaction of user.They are generated as consequences of a
person interacting with the graphical components in Graphical
User Interface. For example, clicking on a button, moving the
mouse, entering a character through keyboard,selecting an item
from list, scrolling the page etc.

Background Events - Those events that require the interaction of

end user are known as background events. Operating system
interrupts, hardware or software failure, timer expires, an
operation completion are the example of background events.
What is Event Handling?

Event Handling is the mechanism that controls the event and

decides what should happen if an event occurs. This mechanism
have the code which is known as event handler that is executed
when an event occurs. Java Uses the Delegation Event Model to
handle the events. This model defines the standard mechanism to
generate and handle the events.Let's have a brief introduction to
this model. The Delegation Event Model has the following key
participants namely:

Source - The source is an object on which event occurs.

Source is responsible for providing information of the
occurred event to it's handler. Java provide as with classes for
source object.

Listener - It is also known as event handler.Listener is

responsible for generating response to an event. From java
implementation point of view the listener is also an object.
Listener waits until it receives an event. Once the event is
received , the listener process the event an then returns.

The benefit of this approach is that the user interface logic is

completely separated from the logic that generates the event. The
user interface element is able to delegate the processing of an event
to the separate piece of code. In this model ,Listener needs to be
registered with the source object so that the listener can receive the
event notification. This is an efficient way of handling the event
because the event notifications are sent only to those listener that
want to receive them.

AWT UI Elements

A Label object is a component for placing text in a container.
This class creates a labeled button.
Check Box
3 A check box is a graphical component that can be in either an on (true) or
off (false) state.
Check Box Group
The CheckboxGroup class is used to group the set of checkbox.
The List component presents the user with a scrolling list of text items.
Text Field
6 A TextField object is a text component that allows for the editing of a
single line of text.
Text Area
7 A TextArea object is a text component that allows for the editing of a
multiple lines of text.
8 Choice
A Choice control is used to show pop up menu of choices.
9 A Canvas control represents a rectangular area where application can
draw something or can receive inputs created by user.
10 An Image control is superclass for all image classes representing
graphical images.
Scroll Bar
11 A Scrollbar control represents a scroll bar component in order to enable
user to select from range of values.
12 A Dialog control represents a top-level window with a title and a border
used to take some form of input from the user.
File Dialog
13 A FileDialog control represents a dialog window from which the user can
select a file.

AWT Containers

1 Panel is the simplest container. It provides space in which any other
component can be placed, including other panels.

A Frame is a top-level window with a title and a border

A Window object is a top-level window with no borders and no menubar.
AWT Menu Controls

It is the top level class for all menu related controls.

The MenuBar object is associated with the top-level window.

3 The items in the menu must belong to the MenuItem or any of its

4 The Menu object is a pull-down menu component which is displayed
from the menu bar.
CheckboxMenuItem is subclass of MenuItem.

6 PopupMenu can be dynamically popped up at a specified position within
a component.
AWT Event Classes

1 It is the root event class for all AWT events. This class and its subclasses
supercede the original java.awt.Event class.
2 The ActionEvent is generated when button is clicked or the item of a list
is double clicked.
3 The InputEvent class is root event class for all component-level input
On entering the character the Key event is generated.
This event indicates a mouse action occurred in a component.
The object of this class represents the text events.
The object of this class represents the change in state of a window.
8 The object of this class represents the adjustment event emitted by
Adjustable objects.
The object of this class represents the change in state of a window.
10 ContainerEvent
The object of this class represents the change in state of a window.
The object of this class represents the change in state of a window.
The object of this class represents the change in state of a window.

AWT Event Listener Interfaces

This interface is used for receiving the action events.
This interface is used for receiving the component events.
This interface is used for receiving the item events.
This interface is used for receiving the key events.
This interface is used for receiving the mouse events.
This interface is used for receiving the text events.
This interface is used for receiving the window events.
This interface is used for receiving the adjusmtent events.
This interface is used for receiving the container events.
This interface is used for receiving the mouse motion events.
This interface is used for receiving the focus events.

AWT Adapters

An abstract adapter class for receiving focus events.

An abstract adapter class for receiving key events.

An abstract adapter class for receiving mouse events.

An abstract adapter class for receiving mouse motion events.

An abstract adapter class for receiving window events.
Swing UI Elements

A JLabel object is a component for placing text in a container.
This class creates a labeled button.
A JColorChooser provides a pane of controls designed to allow a user to
manipulate and select a color.
A JCheckBox is a graphical component that can be in either an on (true) or
off (false) state.
The JRadioButton class is a graphical component that can be in either an
on (true) or off (false) state. in a group.
A JList component presents the user with a scrolling list of text items.
A JComboBox component presents the user with a to show up menu of
A JTextField object is a text component that allows for the editing of a
single line of text.
9 JPasswordField

A JPasswordField object is a text component specialized for password

A JTextArea object is a text component that allows for the editing of a
multiple lines of text.
A ImageIcon control is an implementation of the Icon interface that paints
Icons from Images
A Scrollbar control represents a scroll bar component in order to enable
user to select from range of values.
JOptionPane provides set of standard dialog boxes that prompt users for a
value or informs them of something.
A JFileChooser control represents a dialog window from which the user
can select a file.
As the task progresses towards completion, the progress bar displays the
task's percentage of completion.
A JSlider lets the user graphically select a value by sliding a knob within a
bounded interval.
A JSpinner is a single line input field that lets the user select a number or
an object value from an ordered sequence.
A database is a separate application that stores a collection of data. Each
database has one or more distinct APIs for creating, accessing, managing,
searching and replicating the data it holds.

Other kinds of data stores can be used, such as files on the file system or
large hash tables in memory but data fetching and writing would not be so fast and
easy with those types of systems.

So nowadays, we use relational database management systems (RDBMS) to

store and manage huge volume of data. This is called relational database because
all the data is stored into different tables and relations are established using
primary keys or other keys known as foreign keys.

A relational database management system (RDBMS) is a database
management system (DBMS) that is based on the relational model as invented by
E. F. Codd, of IBM's San Jose Research Laboratory. Many popular databases
currently in use are based on the relational database model.

RDBMSs are a common choice for the storage of information in new

databases used for financial records, manufacturing and logistical information,
personnel data, and other applications since the 1980s. Relational databases have
often replaced legacy hierarchical databases and network databases because they
are easier to understand and use. However, relational databases have been
challenged by object databases, which were introduced in an attempt to address the
object-relational impedance mismatch in relational databases, and XML databases.
RDBMS data is structured in database tables, fields and records. Each
RDBMS table consists of database table rows. Each database table row consists of
one or more database table fields.

RDBMS store the data into collection of tables, which might be related by
common fields (database table columns). RDBMS also provide relational operators
to manipulate the data stored into the database tables. Most RDBMS use SQL as
database query language. Edgar Codd introduced the relational database model.
Many modern DBMS do not conform to the Codds definition of a RDBMS, but
nonetheless they are still considered to be RDBMS.

The most popular RDBMS are MS SQL Server, DB2, Oracle and MySQL.

What is table?

The data in RDBMS is stored in database objects called tables. The table is
a collection of related data entries and it consists of columns and rows. Remember,
a table is the most common and simplest form of data storage in a relational

What is field?

Every table is broken up into smaller entities called fields. A field is a

column in a table that is designed to maintain specific information about every
record in the table.

What is record or row?

A record, also called a row of data, is each individual entry that exists in a
What is column?

A column is a vertical entity in a table that contains all information

associated with a specific field in a table.

What is NULL value?

A NULL value in a table is a value in a field that appears to be blank, which

means a field with a NULL value is a field with no value. It is very important to
understand that a NULL value is different than a zero value or a field that contains
spaces. A field with a NULL value is one that has been left blank during record
SQL Constraints:

Constraints are the rules enforced on data columns on table. These are used
to limit the type of data that can go into a table. This ensures the accuracy and
reliability of the data in the database.

Constraints could be column level or table level. Column level constraints

are applied only to one column where as table level constraints are applied to the
whole table.

Following are commonly used constraints available in SQL:

NOT NULL Constraint: Ensures that a column cannot have NULL value.

DEFAULT Constraint: Provides a default value for a column when none is


UNIQUE Constraint: Ensures that all values in a column are different.

PRIMARY Key: Uniquely identified each rows/records in a database table.

FOREIGN Key: Uniquely identified a rows/records in any another database


CHECK Constraint: The CHECK constraint ensures that all values in a

column satisfy certain conditions.

INDEX: Use to create and retrieve data from the database very quickly.

Data Integrity:

The following categories of the data integrity exist with each RDBMS:
Entity Integrity: There are no duplicate rows in a table.

Domain Integrity: Enforces valid entries for a given column by restricting

the type, the format, or the range of values.

Referential integrity: Rows cannot be deleted, which are used by other


User-Defined Integrity: Enforces some specific business rules that do not

fall into entity, domain or referential integrity.

Database Normalization

Database normalization is the process of efficiently organizing data in a

database. There are two reasons of the normalization process:

Eliminating redundant data, for example, storing the same data in more than
one tables.

Ensuring data dependencies make sense.

Both of these are worthy goals as they reduce the amount of space a
database consumes and ensure that data is logically stored. Normalization consists
of a series of guidelines that help guide you in creating a good database structure.

Normalization guidelines are divided into normal forms; think of form as the
format or the way a database structure is laid out. The aim of normal forms is to
organize the database structure so that it complies with the rules of first normal
form, then second normal form, and finally third normal form.
MySQL Database

MySQL is a fast, easy-to-use RDBMS being used for many small and
big businesses. MySQL is developed, marketed, and supported by
MySQL AB, which is a Swedish company. MySQL is becoming so
popular because of many good reasons:

MySQL is released under an open-source license. So you have

nothing to pay to use it.

MySQL is a very powerful program in its own right. It handles a

large subset of the functionality of the most expensive and
powerful database packages.

MySQL uses a standard form of the well-known SQL data


MySQL works on many operating systems and with many

languages including PHP, PERL, C, C++, JAVA, etc.

MySQL works very quickly and works well even with large data

MySQL is very friendly to PHP, the most appreciated language for

web development.

MySQL supports large databases, up to 50 million rows or more in

a table. The default file size limit for a table is 4GB, but you can
increase this (if your operating system can handle it) to a
theoretical limit of 8 million terabytes (TB).

JDBC stands for Java Database Connectivity, which is a
standard Java API for database-independent connectivity
between the Java programming language and a wide range
of databases.

The JDBC library includes APIs for each of the tasks mentioned below that
are commonly associated with database usage.

Making a connection to a database.

Creating SQL or MySQL statements.

Executing SQL or MySQL queries in the database.

Viewing & Modifying the resulting records.

Fundamentally, JDBC is a specification that provides a complete set of

interfaces that allows for portable access to an underlying database. Java can
be used to write different types of executables, such as

Java Applications

Java Applets

Java Servlets

Java ServerPages (JSPs)

Enterprise JavaBeans (EJBs).

All of these different executables are able to use a JDBC driver to access a
database, and take advantage of the stored data.

JDBC provides the same capabilities as ODBC, allowing Java programs to

contain database-independent code.

JDBC Architecture

The JDBC API supports both two-tier and three-tier processing models for
database access but in general, JDBC Architecture consists of two layers

JDBC API: This provides the application-to-JDBC Manager connection.

JDBC Driver API: This supports the JDBC Manager-to-Driver Connection.

The JDBC API uses a driver manager and database-specific drivers to

provide transparent connectivity to heterogeneous databases.

The JDBC driver manager ensures that the correct driver is used to access
each data source. The driver manager is capable of supporting multiple
concurrent drivers connected to multiple heterogeneous databases.

Following is the architectural diagram, which shows the location of the

driver manager with respect to the JDBC drivers and the Java application
Common JDBC Components

The JDBC API provides the following interfaces and classes

DriverManager: This class manages a list of database drivers. Matches

connection requests from the java application with the proper database
driver using communication sub protocol. The first driver that recognizes a
certain subprotocol under JDBC will be used to establish a database

Driver: This interface handles the communications with the database server.
You will interact directly with Driver objects very rarely. Instead, you use
DriverManager objects, which manages objects of this type. It also abstracts
the details associated with working with Driver objects.

Connection: This interface with all methods for contacting a database. The
connection object represents communication context, i.e., all communication
with database is through connection object only.
Statement: You use objects created from this interface to submit the SQL
statements to the database. Some derived interfaces accept parameters in
addition to executing stored procedures.

ResultSet: These objects hold data retrieved from a database after you
execute an SQL query using Statement objects. It acts as an iterator to allow
you to move through its data.

SQLException: This class handles any errors that occur in a database


What is JDBC Driver?

JDBC drivers implement the defined interfaces in the JDBC API, for
interacting with your database server.

For example, using JDBC drivers enable you to open database connections
and to interact with it by sending SQL or database commands then receiving
results with Java.

The Java.sql package that ships with JDK, contains various classes with
their behaviours defined and their actual implementaions are done in third-
party drivers. Third party vendors implements the java.sql.Driver interface
in their database driver.

JDBC Drivers Types

JDBC driver implementations vary because of the wide variety of operating

systems and hardware platforms in which Java operates. Sun has divided the
implementation types into four categories, Types 1, 2, 3, and 4, which is
explained below

Type 1: JDBC-ODBC Bridge Driver

In a Type 1 driver, a JDBC bridge is used to access ODBC drivers

installed on each client machine. Using ODBC, requires configuring
on your system a Data Source Name (DSN) that represents the target

When Java first came out, this was a useful driver because most
databases only supported ODBC access but now this type of driver is
recommended only for experimental use or when no other alternative
is available.

The JDBC-ODBC Bridge that comes with JDK 1.2 is a good example
of this kind of driver.

Type 2: JDBC-Native API

In a Type 2 driver, JDBC API calls are converted into native C/C++
API calls, which are unique to the database. These drivers are
typically provided by the database vendors and used in the same
manner as the JDBC-ODBC Bridge. The vendor-specific driver must
be installed on each client machine.

If we change the Database, we have to change the native API, as it is

specific to a database and they are mostly obsolete now, but you may
realize some speed increase with a Type 2 driver, because it eliminates
ODBC's overhead.

The Oracle Call Interface (OCI) driver is an example of a Type 2 driver.

Type 3: JDBC-Net pure Java

In a Type 3 driver, a three-tier approach is used to access databases.

The JDBC clients use standard network sockets to communicate with
a middleware application server. The socket information is then
translated by the middleware application server into the call format
required by the DBMS, and forwarded to the database server.

This kind of driver is extremely flexible, since it requires no code

installed on the client and a single driver can actually provide access
to multiple databases.

You can think of the application server as a JDBC "proxy," meaning

that it makes calls for the client application. As a result, you need
some knowledge of the application server's configuration in order to
effectively use this driver type.

Your application server might use a Type 1, 2, or 4 driver to

communicate with the database, understanding the nuances will prove

Type 4: 100% Pure Java

In a Type 4 driver, a pure Java-based driver communicates directly
with the vendor's database through socket connection. This is the
highest performance driver available for the database and is usually
provided by the vendor itself.

This kind of driver is extremely flexible, you don't need to install

special software on the client or server. Further, these drivers can be
downloaded dynamically.

MySQL's Connector/J driver is a Type 4 driver. Because of the

proprietary nature of their network protocols, database vendors
usually supply type 4 drivers.

Which Driver should be Used?

If you are accessing one type of database, such as Oracle, Sybase, or

IBM, the preferred driver type is 4.

If your Java application is accessing multiple types of databases at the

same time, type 3 is the preferred driver.
Type 2 drivers are useful in situations, where a type 3 or type 4 driver
is not available yet for your database.

The type 1 driver is not considered a deployment-level driver, and is

typically used for development and testing purposes only.
Chapter 6

Screen Layouts
Snapshot 1 : Login Page

Snapshot 2 Home Page

Snapshot 3 Check In
Snapshot 4 No Such Room
Snapshot 5 Delete Record
Snapshot 6 Remaining space
Snapshot 7 Reservation
Snapshot 8 Remaining Space
Snapshot 9 Record Added Successfully
Snapshot 10 Billing/Checkout
Snapshot 11 No Such Room
Snapshot 12 Checkout Confirmation Massage
Snapshot 13 Thank you Massage
Chapter 7
Based on the findings of this study, the researcher concludes the following:

1. The respondents who took part in this study are already mature in age,

responsible and reliable. They are also aware of whats happening in the

hotel industry (both international and domestic hotels) and are deeply

concerned about the improvement of the hotel facilities, services and

reasonable prices .

2. The respondents have given an overall rating of Agree to each of the

criteria. Most of the respondents believe that the branding has a great

relationship in differentiation of hotel in hotel industry. This shows that

respondents knew the importance of branding and differentiation to the

current state of things in the Hotel. For them costumers satisfaction was

important requirement for the success of the hotel.

3. The statistics show that there is no significant difference or there is a

significant relationship in the perception of the respondents of the Hotel

sector in Taiwan pertaining to hotel accommodation.

4. There are several factors affecting the progress of some hotel

establishments in Taiwan. There are some factors to be considered in hotels

improvement i.e. training of the staffs and proper positioning of the hotel.
5. The Analysis of Variance between the perception of the respondents in

international and domestic hotels reveals no significant results. From the

data and ANOVA analysis, the significance level of four variables discussed

in Chapter 4 is greater than .05. Meaning to say, the performance of both

International and Domestic Hotels is similar to each other based on the

perception of the respondents.