VOCATIONAL TRAINING ON Flight Reservation APPLICATION PROGRAMMING
VOCATIONAL TRAINING ON Flight Reservation APPLICATION PROGRAMMING
ON
AIRLINE RESERVATION
SYSTEM
CORE JAVA
Submitted by:
Sahil Sharma (64041)
Abhimanyu (64045)
Anuj Mehta (64003)
Rishu Sharma (64007)
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
CERTIFICATE
This is to certify that the vocational training report “Airline Reservation System” is prepared
by the following individuals under my supervision at NIELIT (National Institute of Electronics
& Information Technology).
GUIDE:
Dr. Balvir Singh Thakur
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
TABLE OF CONTENTS
1. Acknowledgement 4
2. Organization Profile 5
3. Introduction to Java 7
4. Modules of Java 11
7. Database Architecture 56
8. Screenshots 60
9. Conclusion 68
10. Bibliography 69
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
ACKNOWLEDGEMENT
We would like to take this opportunity to express our profound gratitude and deep regards to
our course Instructor Ms. Anjana (Faculty, NIELIT) for her exemplary guidance and monitoring
throughout the course of this training. We would also like to acknowledge the faculty of NIELIT
for their constant help and guidance. We express our sincere thanks to all our fellow course
mates who supported us in training through various informal discussions which led to our
better understanding of the concepts.
We owe our regards to the entire faculty of the University Institute of Information
Technology, H.P.U., Shimla-5 from where we learnt the basics of Computer Science.
ORGANIZATION PROFILE
NIELIT Shimla Centre is located in the heart of the city in lower Jakhoo area. The Centre was
inaugurated on April 10, 1995 by the then Chief Minister Sh. Virbhadra Singh with the objective of
sensitizing youth of the state towards IT and spread IT culture in the State of Himachal Pradesh.
The Centre has been functioning as a customer centered IT organization with complete focus on
customer needs and expectations so as to fulfill them with a targeted strategy and commitment.
The Centre opened its extension Centre at Block 24, SDA Complex, Kasumpti area in October
2011 and has been running its training activities for students and corporate participants.
The centre’s onus in regard to the field of IT has always been in the key business domains of IT
precisely Education and Training, Software Development, Total IT Solutions and other customer
needs based services.
The Centre has good infrastructure in terms of six spacious classrooms out of which three fitted
with multimedia projectors, two fully networked dedicated computer labs for the students for
carrying out practical assignments, Internet connectivity through high-speed broadband and library
facility with more than 500 books to support the approved curriculum being taught to students of
formal and professional courses. Qualified, experienced and dedicated faculties are with us. Our
students gain technical and soft skills as per the needs of the industry and society.
The Centre runs training programs through both formal and non-formal Courses. Under formal
mode, Centre has been running Post Graduate Diploma in Computer Applications (PGDCA) from
MCRP University. The course is being conducted in regular mode. Whereas in non-formal mode,
Centre has been DOEACC O-Level and A-level courses. In addition, it also offers various short
term courses on advance and latest technologies for students pursuing Engineering and technical
education. Many students are getting placement in different organizations through our facility
management projects. Our key contributions in Education and training include:
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Trained more than 13500 students since inception through various Long and Short Term
courses in IT.
Trained more than 17400 participants from various government departments on foundation
The Centre has been impating IT Education based services in all districts of the states
covering rural areas as a part of implementing Capacity Building Initiative of NIELIT i.e. IT
literacy, O level Hardware/Software etc. for weaker section of society through scheme funded by
Govt. of India.
Centre has undertaken various software development projects using Web technologies/Client
Server environment for many Govt. organizations. Successfully implemented Software Solution for
H.P. State Civil Supplies Corporation, Town and Country Planning, HPSEB, Disaster Management
Authority, Shikayat Nivaran Kendra for Irrigation and Public Health Department and others.
The centre is entrusted for conduction of recruitment examinations for government organization
for IT related vacancies. It has been actively providing various facility management services to a
number of Government Organizations for implementing e-governance solutions.
All students and parents are welcomed to browse our website for information and can contact us
for any query on the numbers mentioned on contact us page. We look forward to your suggestions
& active participation in our venture.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
INTRODUCTION TO JAVA
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Introduction to Java
Java is related to C++, which is directing descendent of C. Much of the character of Java is
inherited from these two languages. From C, Java derives its syntax. Many of Java’s object-
oriented features were influenced by C++. In fact, several of Java’s defining characteristics come
from – or responses to – its predecessors. Moreover, the creation of Java was deeply rooted in
the process of refinement and adaptation that has been occurring in computer programming
languages for the past three decades.
Platform independence
Platform independence means that programs written in the Java language must run similarly on
any supported hardware/operating-system platform. One should be able to write a program once,
compile it once, and run it anywhere. Platform-independent Java is essential to the Java
Enterprise Edition strategy, and an even more rigorous validation is required to certify an
implementation. This environment enables portable server-side applications, such as Web
services, Servlets, and Enterprise JavaBeans, as well as with embedded systems based on OSGi,
using Embedded Java environments.
Memory management
One of the ideas behind Java's automatic memory management model is that programmers be
spared the burden of having to perform manual memory management. In Java, this potential
problem is avoided by automatic garbage collection. The use of garbage collection in a language
can also affect programming paradigms. If, for example, the developer assumes that the cost of
memory allocation/recollection is low, they may choose to more freely construct objects instead
of pre-initializing, holding and reusing them. With the small cost of potential performance
penalties (inner-loop construction of large/complex objects), this facilitates thread-isolation (no
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
need to synchronize as different threads work on different object instances) and data-hiding. The
use of transient immutable value-objects minimizes side-effect programming.
The Java Runtime Environment or JRE, or J2RE is the software required to run any application
deployed on the Java Platform. End-users commonly use a JRE in software packages and Web
browser plug-ins. Sun also distributes a superset of the JRE called the Java 2 SDK (more
commonly known as the JDK), which includes development tools such as the Java compiler,
Javadoc, Jar and debugger.
One of the unique advantages of the concept of a runtime engine is that errors (exceptions)
should not 'crash' the system. Moreover, in runtime engine environments such as Java there exist
tools that attach to the runtime engine and every time that an exception of interest occurs they
record debugging information that existed in memory at the time the exception was thrown
(stack and heap values). These Automated Exception Handling tools provide 'root-cause'
information for exceptions in Java programs that run in production, testing or development
environments.
A Java Virtual Machine (JVM) is a set of computer software programs and data structures which
implements a specific virtual machine model. This model accepts a form of computer
intermediate language, commonly referred to as Java bytecode, which conceptually represents
the instruction set of a stack-oriented, capability architecture. This code is most often generated
by Java language compilers, although the JVM can also be targeted by compilers of other
languages. JVMs using the "Java" trademark may be developed by other companies as long as
they adhere to the JVM standard published by Sun (and related contractual obligations).
The JVM is a crucial component of the Java Platform. Because JVMs are available for many
hardware and software platforms, Java can be both middleware and a platform in its own right –
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
hence the expression "write once, run anywhere." The use of the same bytecode for all platforms
allows Java to be described as "compile once, run anywhere", as opposed to "write once, compile
anywhere", which describes cross-platform compiled languages. The JVM also enables such
unique features as Automated Exception Handling which provides 'root-cause' debugging
information for every software error (exception) independent of the source code
Java bytecode is the form of instructions that the Java virtual machine executes. Each bytecode
instruction is one byte in length (hence the name), thus the number of bytecodes is limited to
256. Not all 256 possible bytecode values are used. In fact, Sun Microsystems, the original
creators of the Java programming language, the Java virtual machine and other components of
the Java Runtime Environment, have set aside a number of values to be permanently
unimplemented. A Java programmer does not need to be aware of or understand Java bytecode at
all. However, as suggested in the IBM developer Works journal, "Understanding bytecode and
what bytecode is likely to be generated by a Java compiler helps the Java programmer in the
same way that knowledge of assembler helps the C or C++ programmer."
It is possible to write Java bytecode by hand, though this is almost never done, as modern
compilers are able to produce well performing bytecode and such code is far less readable than
Java source. Originally one compiler existed, the javac compiler from Sun Microsystems, which
compiles Java source code to Java bytecode; but because all the specifications for Java bytecode
are available, other parties have supplied compilers that produce Java bytecode. javac is the
primary Java compiler, included in JDK from Sun Microsystems. The compiler accepts source
codes conforming to the Java language specification (JLS) and produce bytecodes conforming to
the Java Virtual Machine specification (JVMS). javac is coded in Java itself.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
MODULES OF JAVA
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
1. Classes
2. Inheritance
3. Packages
4. Interface
5. Exception Handling
6. Applets
8. Swings
9. Event Handling
1.Classes
Objects
Everything in Java is an object. An object is a collection of data and actions that make up a
programming entity. A 'car' object, for example, might have some data and some actions it can
take .Objects include the ability to hide what's going on 'inside' the object from other
programmers, which is useful for writing code that others can work with but not easily mess up.
Constructors
A constructor is a piece of code that runs when an instance of an object is created. A constructor
is indicated by a method that:
Java objects are used in one of two ways. The most common way is as a programming
component that is instantiated by another program. However, some objects are endowed with the
ability to be run as programs (it has to start running somewhere!). This is achieved by putting a
'main' method in the object.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Inner classes
An inner class is a class that is declared within another class. Scoping in this case is similar to
variables declared within a class.
2.Inheritance
It is possible to define an object that uses all of the pre-existing functions of another object we or
someone else programmed earlier; this is called inheritance. Java supports inheritance that
enables a class to inherit data members and methods
from another class. Inheritance enables us to reuse the functionalities and capabilities of the
existing class by extending a new class from the existing class
In inheritance, the class that inherits the data members and methods from another class is known
as the subclass. The class from which the subclass inherits is known as the superclass. The
superclass is also referred to as the base class, and the subclass is referred to as the derived class.
We can create additional data members and methods to add more features in a subclass. A
superclass can also be a subclass of another class.
The superclass represents the generalized properties, which are required for the hierarchy of the
superclass. The subclass represents specialization, in which data members and methods specific
for the subclass are added to the inherited data members and the superclass methods.
In single level inheritance, a subclass is derived from a single superclass. For example, subclass
B and C inherit the properties of a single superclass, A.
Class A
Class B Class C
Multilevel Inheritance
In multilevel inheritance, a subclass inherits the properties of another subclass. For example,
class A is a superclass for the class B; and class B is a superclass for the subclass, class C. We
can include any number of levels in multilevel inheritance.
Class A
Class B
Class C
Method Overriding
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Method overriding is defined as creating a method in the subclass that has the same return type
and signature as a method defined in the superclass. Signature of a method includes the name,
number, sequence, and type of arguments of a method. The created method of the subclass hides
the method defined in the superclass.
3.Packages
A Java package is a mechanism for organizing Java classes into namespaces. Java packages can
be stored in compressed files called JAR files, allowing classes to download faster as a group
rather than one at a time. Programmers also typically use packages to organize classes belonging
to the same category or providing similar functionality.
Java source files can include a package statement at the top of the file to designate the package
for the classes the source file defines.
Classes in the same package can access each other's protected members.
Classes
Interfaces
Enumerated types
Importing packages
Like many programming languages, Java programs are built in pieces that are generally stored in
separate files. A given file, if it refers to pieces that are stored in other files, must be told where
to find those other pieces. For example, Java provides a programming object called a Vector,
which is used to store data in a structured way. A piece of programming code that makes use of
the Vector object must contain a line like:
import java.util.Vector;
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
4.Interfaces
An interface is a collection of methods and static data members that can be implemented by any
number of classes residing in a class hierarchy. Interface is known as a prototype for a class.
Methods defined in an interface are only abstract methods.
An abstract method contains only the declaration for a method without any implementation
details. The implementation of an abstract method is defined in the class implementing the
interface. We can implement multiple interfaces in a single class by using a comma between the
interface names.
interface <interface_name>
// interface body
We can implement an interface in one or more than one class before defining it. The public
access specifier must be specified with the methods declared in the interface.
{
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
5.Exception Handling
The unexpected situations that may occur during program execution are:
Exception Classes
To handle exceptions, the java run-time system searches for an exception-handler. In Java, a
catch statement is an exception-handler that is used to handle an exception. The search for an
exception-handler begins with the method in which the exception is raised. If no appropriate
exception-handler is found, the java run-time system searches the exception-handler in the next
higher method hierarchy. The type of exception handled by the exception-handler should match
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
with the type of exception thrown. The java run-time system proceeds with the normal execution
of the program after an exception gets handled. If no appropriate exception-handler is found by
the java run-time system, the program is terminated. In java, the Throwable class is the
superclass of all the exception classes. Object class is the base class of the exception hierarchy.
The Exception class and the Error class are two subclasses of the Throwable class.
try: The try block encloses the statements that might raise an exception within it and
defines the scope of the exception-handlers associated with it. If an exception is raised
within the try block, the appropriate exception-handler that is associated with the try
block processes the exception.
catch: In Java, the catch block is used as an exception-handler. A try block must have at
least one catch block that follows it immediately. The catch clause specifies the exception
type needed to be caught.
throw: We can throw an exception explicitly using the throw statement. The throw
statement causes termination of the normal flow of control of the java code and stops the
execution of the subsequent statements if an exception is thrown when the throw
statement is executed. The throw clause transfers the
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Object
Throwable
Exception Error
InterruptedException
ClassNotFoundException ThreadDeath
IllegalAccessException RuntimeException
IndexOutOfBoundException NullPointerException
ArrayIndexOutOfBoundException
IllegalArgumentException
StringIndexOutOfBoundException
NumberFormatException
Exception Hierarchy
control to the nearest catch block handling the type of exception object throws. If no such catch
block exists, the program terminates.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
throws: The throws statement is used by a method to specify the types of exceptions the
method throws. If a method is capable of raising an exception that it does not handle, the
method must specify that the exception have to be handled by the calling method.
finally: When an exception is raised, the statements in the try block written after the
statement in which the exception occurred are ignored. The finally block is used to
process certain statements, no matter whether an exception is raised or not. The block of
code attached with the finally clause is executed after a try-catch block has been
executed.
6.Applets
Java applet is an applet delivered in the form of Java bytecode. Java applets can run in a Web
browser using a Java Virtual Machine (JVM), or in Sun's AppletViewer, a stand-alone tool for
testing applets. Java applets are usually written in the Java programming language but they can
also be written in other languages that compile to Java bytecode. Applets are developed to
support the GUI in Java.
init()
When an applet is
Initializing an Applet opened for the first
time or reopened
start()
When an applet
Starting an Applet receives focus
stop()
When an applet loses
Stopping an Applet focus
destroy()
When an applet is
Destroying an Applet destroyed
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
7.Event Handling
Events
An event is an object that describes a change of state in a source component. The source
components can be the elements of the Graphical User Interface (GUI). It can be generated as a
consequence of a person interacting with these source components. Some of the activities that
cause events to be generated are pressing a button, entering a character via keyboard, selecting
an item in a list, and clicking the mouse. The operating system traps the event and the data
associated with it, such as time at which the event occurred and the event type. The event type
can be a mouse event, window event, or a mouse motion event. The operating system then passes
this data to the application to which the event belongs.
In Java, events are supported by the classes and interfaces defined in the java.awt.event package.
The event-driven program contains objects with the methods that control the various events and
circumstances.
Event Sources
An event source is an object that generates an event. This occurs when the internal state of that
object changes in some way. A source must register listeners in order for the listeners to receive
notifications about a specific event. Each type of event has its own registration method. All the
registered listeners are notified about the generation of an event and receive a copy of the vent
object. This is known as the multicasting the event. Some sources allow only one listener to
register. This is known as unicasting the vent. Event sources also provide methods to unregister
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
the event listeners. The notification about the event generation is passed only to registered
listener.
Event sources are the Abstract Window Toolkit (AWT) GUI components, such as buttons,
choice lists, and scroll bars. An event Source can generate more than one type of event
depending upon the change of state of the event source.
An event listener is an object that listens for a specific event and is notified when that specific
event occurs. It has two major requirements. First, it must have been registered with one or more
sources to receive notifications about specific types of events. Second, it must implement
methods to receive and process these notifications. Commonly used event listeners are
ActionListener, MouseListener, WindowListener, MouseMotionListener, etc.
An event-handler is called by the event listener whenever a specific event occurs. In Java, event
listeners are interfaces and the event-handler is a methods declared in the event listener interface
that is implemented by the application. The methods that are defined in the set of interfaces and
classes found in the java.awt.event package receive and process the events.
AWT continues to provide the core of the GUI event subsystem and the interface between the
native windowing system and the Java application, providing the structural underpinnings on
which Swing relies. It also provides several basic layout managers, a data transfer package for
use with the Clipboard and Drag and Drop, the interface to input devices such as mice and
keyboards, as well as access to the system tray on supporting systems.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
An AWT control is a component that enables end users to interact with applications created in
Java. All AWT controls in Java are subclass of the Component class. The component class
provides the add() method to add AWT components, such as an applet or a window, to
containers. The various classes that can be used for creating AWT controls are:
TextField: Text fields are user interface components that accept text input from an end
user. It enables you to type text in a single line. An instance of the TextField class is used
to create a text field.
TextArea: Text areas are also used to accept text input from an end user, but it enables
you to type text in multiple lines. An instance of the TextArea class is used to create a
text area.
Button: Buttons are AWT controls that are used for handling events. Java provides the
Button class to create AWT button components.
List: List control is scrollable list of text items that enables you to select either one item
or multiple items. A list can be created by using the List class in Java.
CheckBox: Check boxes are the components that exist in dual state, checked or
unchecked. The state of it can be changed by clicking it. It is created by using the
CheckBox class.
Choice: These are the combination boxes or also known as drop-down menus, created by
using the Choice class in Java. It enables the user to select a single item from the menu.
Label: Labels are used for displaying a single lime of text in a container. It is created by
using the Label class.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
9.Swing
Swing is a GUI toolkit for Java. It is one part of the Java Foundation Classes (JFC). Swing
includes graphical user interface (GUI) widgets such as text boxes, buttons, split-panes, and
tables. The Swing toolkit, shipped as part of the Java SE platform, provides a rich set of GUI
components. But Swing offers much more functionality than a collection of standard widgets.
Swing widgets provide more sophisticated GUI components than the earlier Abstract Window
Toolkit. Since they are written in pure Java, they run the same on all platforms, unlike the AWT
which is tied to the underlying platform's windowing system. Swing supports Pluggable Look
and Feel (PL&F) – not by using the native platform's facilities, but by roughly emulating them.
This means you can get any supported look and feel on any platform. These are the collection of
lightweight visual components that provide a replacement for the heavyweight AWT
components. The major difference between the lightweight visual components and heavyweight
visual components is that lightweight components have transparent pixels while the latter are
opaque. The disadvantage of lightweight components is slower execution. The advantage is
uniform behavior on all platforms.
The JComponent class is the root of the swing hierarchy, which is an extension of the AWT
container class. The class hierarchy of the swing components is categorized into:
Atomic Components:
JTextField
JComboBox
JCheckBox
JButton
JLabel
JTable
JFrame
A Frame is a top-level window with a title and a border. The size of the frame includes any area
designated for the border. A frame, implemented as an instance of the JFrame class, is a window
that typically has decorations such as a border, a title, and buttons for closing and iconifying the
window. Applications with a GUI typically use at least one frame. Applets sometimes use
frames, as well.
JPanel
The JPanel class provides general-purpose containers for lightweight components. By default,
panels do not add colors to anything except their own background; however, you can easily add
borders to them and otherwise customize their painting. In many types of look and feel, panels
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
are opaque by default. Opaque panels work well as content panes and can help with painting
efficiently. One can change a panel's transparency by invoking the setOpaque method. A
transparent panel draws no background, so that any components underneath show through.
JLabel
With the JLabel class, you can display unselectable text and images. If you need to create a
component that displays a string, an image, or both, you can do so by using or extending JLabel.
By specifying HTML code in a label's text, you can give the label various characteristics such as
multiple lines, multiple fonts or multiple colors. If the label uses just a single color or font, you
can avoid the overhead of HTML processing by using the setForeground or setFont method
instead.
JList
A JList presents the user with a group of items, displayed in one or more columns, to choose
from. Lists can have many items, so they are often put in scroll panes.
JComboBox
A JComboBox, which lets the user choose one of several choices, can have two very different
forms. The default form is the uneditable combo box, which features a button and a drop-down
list of values. The second form, called the editable combo box, features a text field with a small
button abutting it. The user can type a value in the text field or click the button to display a drop-
down list.
JButton
The JButton class provides the functionality of a push button. JButton allows an icon, a string, or
both to be associated with push button.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
JTextField
A text field is a basic text control that lets the user enter a small amount of text. When the user
indicates that text entry is complete (usually by pressing Enter), the text field fires an action
event. If you need to obtain more than one line of input from the user
JTextArea
The JTextArea class provides a component that displays multiple lines of text and optionally
allows the user to edit the text. If the displayed text has a limited length and is never edited by
the user, use a label instead.
JDBC is an API for the Java programming language that defines how a client may access a
database. It provides methods for querying and updating data in a database. JDBC is oriented
towards relational databases. The Java Platform, Standard Edition includes the JDBC API
together with an ODBC implementation of the API enabling connections to any relational
database that supports ODBC. This driver is native code and not Java, and is closed source.
JDBC connections support creating and executing statements. These statements may be update
statements such as SQL CREATE, INSERT, UPDATE and DELETE or they may be query
statements using the SELECT statement. Additionally, stored procedures may be invoked
through a statement. Statements are one of the following types:
DriverManager
The DriverManager will try to load as many drivers as it can find and then for any given
connection request, it will ask each driver in turn to try to connect to the target URL. It is
strongly recommended that each Driver class should be small and standalone so that the Driver
class can be loaded and queried without bringing in vast quantities of supporting code. When a
Driver class is loaded, it should create an instance of itself and register it with the
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
DriverManager. This is the basic service for managing a set of JDBC drivers. This means that a
user can load and register a driver by calling
Class.forName ("sun.jdbc.odbc.JdbcOdbcDriver")
Driver
It is the interface that every driver class must implement. The Java SQL framework allows for
multiple database drivers. Each driver should supply a class that implements the Driver interface.
Connection
It is a connection (session) with a specific database. SQL statements are executed and results are
returned within the context of a connection. A Connection object's database is able to provide
information describing its tables, its supported SQL grammar, its stored procedures, the
capabilities of this connection, and so on. This information is obtained with the getMetaData
method.
Statement
The statement is sent to the database server each and every time. The object used for executing a
static SQL statement and returning the results it produces. By default, only one ResultSet object
per Statement object can be open at the same time. Therefore, if the reading of one ResultSet
object is interleaved with the reading of another, each must have been generated by different
Statement objects. All execution methods in the Statement interface implicitly close a
statement’s current ResultSet object if an open one exists.
ResultSet
A table of data representing a database result set, which is usually generated by executing a
statement that queries the database. A ResultSet object maintains a cursor pointing to its current
row of data. Initially the cursor is positioned before the first row. The next method moves the
cursor to the next row, and because it returns false when there are no more rows in the ResultSet
object, it can be used in a while loop to iterate through the result set.
A default ResultSet object is not updatable and has a cursor that moves forward only. Thus, you
can iterate through it only once and only from the first row to the last row. It is possible to
produce ResultSet objects that are scrollable and/or updatable.
PreparedStatement
The statement is cached and then the execution path is pre determined on the database server
allowing it to be executed multiple times in an efficient manner. It is an object that represents a
precompiled SQL statement. A SQL statement is precompiled and stored in a PreparedStatement
object. This object can then be used to efficiently execute this statement multiple times.
Update statements such as INSERT, UPDATE and DELETE return an update count that
indicates how many rows were affected in the database. These statements do not return any other
information.
Query statements return a JDBC row result set. The row result set is used to walk over the result
set. Individual columns in a row are retrieved either by name or by column number. There may
be any number of rows in the result set. The row result set has metadata that describes the names
of the columns and their types. There is an extension to the basic JDBC API in the javax.sql
package that allows for scrollable result sets and cursor support among other things.
Airline Reservation
System
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
PROBLEM DEFINITION
The definition of our problem lies in manual system and a fully automated system.
Manual system : The system is very time consuming and lazy. This system is more prone to
errors and sometimes the approach to various problems is unstructured.
Technical system: With the advent of latest technology if we do not update our system then
our business result in losses gradually with time. The technical systems contain the tools of latest
trend i.e. computers printers, fax, Internet etc. The systems with this technology are very fast,
accurate, user-friendly and reliable.
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
TECHNICAL SYSTEM
Project Development
Phases
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
PHASES:
Requirement Gathering
HARDWARE:
SOFTWARE:
System Analysis
This is the initial phase in project execution. This phase involves conducting a
detailed study of the existing system to depict the functionality of the system.
The analysis phase is the most crucial phase in a project because it helps
developers to identify the various processes and their function in the system. The
project team analyzes the existing system along with its shortcomings before
moving on to the development phase.
Development: This phase involves developing the project based on business
specifications. The development phase was carried out in two ways
simultaneously:
1. Front End (GUI): Front End or GUI (Graphical User Interface) of this project
was designed in Java using AWT (Abstract Window Toolkit), Frames and
Swings.
Java
From C, Java derives its syntax. Many of Java’s object-oriented features were influenced
by C++. In fact, several of Java’s defining characteristics come from – or responses to –
its predecessors. Moreover, the creation of Java was deeply rooted in the process of
refinement and adaptation that has been occurring in computer programming
languages for the past three decades.
2.Back End (Database): We have used Apache Derby as Database for this project.
Java’s JDBC (Java Data Base Connectivity) feature was used for connecting
database with the application.
BLOCK DIAGRAM
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
BOOKING
DEPARTMENT
RECEIVE
CUSTOMER
Flight REQUEST
Booking, cancellation
AIRLINE
PASSENGER RESERVATION
SYSTEM
Reservation, from, to, time, Flight code, class, Fare, number of passengers, Fare.
Cancellation: ticket no
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
SYSTEM DESIGN
In this phase, the requirement gathered in the SRS document is used as an input and software
architecture that is used for implementing system development is derived.
In this phase initially I had designed E-R diagram of the processes, in order to identify various
entities and relationship set, entity set, attributers, link attributes The Diagram of this process as
under.
After this step We had tried design the data base for the new system.
Relationship set
Entity set
Attributes
Mob no
confirm password
Username Last v
v Password
Name Email
First Name
USER
Creates
ACCOUNT
Figure:-1
Email
Children
Adults
Mobile no
Name
PASSENGER
Booking Books
date Ticket id
Time
Class N
TICKET
Figure:-2
Children
Adults
To Booking v
v Class
Date Time
From
Ticket id
PASSENGER
Cancel
Cancel
Figure:-3
USE-CASE- VIEW
<<include>>
<<include>>
<<include>>
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
<<include>>
Book flight
user
<<include>> Database
select the flight type
book ticket
<<extends>>
cancel ticket
payment
Figure:-4
login
cancel ticket
Figure:-5
ACTIVITY DIAGRAM
An Activity diagram is a variation of a special case of a state machine, in which the states are
activities representing the performance of operations and the transitions are triggered by the
completion of the operations. The purpose of Activity diagram is to provide a view of flows and
what is going on inside a use case or among several classes. We can also use activity diagrams to
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
model code-specific information such as a class operation. Activity diagrams are very similar to
a flowchart because you can model a workflow from activity to activity
ACTIVITY DIAGRAM FOR BOOKING FLIGHTS:
user
user administrator
database
validate the
submit the
details
criteria
if details are
valid
yes
no
reserve tickets and
send information
update the
database
Figure:-6
ACTIVITY DIAGRAM FOR CANCEL FLIGHT:
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
user administrator
database
user
if details valid
no yes cancel the
reservation
update
databases
Figure:-7
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
CODING
Here you will get whole coding which is done by our group to create this project
jLabel1.setText("Username");
jPanel1.add(jLabel1);
jLabel1.setBounds(30, 40, 100, 14);
jLabel2.setText("Password");
jPanel1.add(jLabel2);
jLabel2.setBounds(30, 100, 100, 14);
jPanel1.add(jTextField1);
jTextField1.setBounds(172, 30, 108, 30);
jTextField2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jTextField2ActionPerformed(evt);
}
});
jPanel1.add(jTextField2);
jTextField2.setBounds(172, 94, 108, 30);
jButton2.setText("SignUp");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});
jPanel1.add(jButton2);
jButton2.setBounds(100, 190, 80, 30);
jButton1.setText("Login");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
package flightreservation;
import java.awt.*;
import java.sql.*;
import java.sql.Statement;
import java.text.DateFormat;
import java.util.Date;
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
public class fromto extends javax.swing.JFrame {
public fromto() {
initComponents();
}
private void initComponents() {
int cd=Integer.parseInt(children);
price=ad*8000+cd*2000;
}catch(NumberFormatException e){
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
System.out.println(e.getMessage());
}
}
if(jRadioButton3.isSelected()||jRadioButton4.isSelected()||jRadioButton5.isSelected())
if(jRadioButton1.isSelected()||jRadioButton2.isSelected())
d inserted successful");
JOptionPane.showMessageDialog(null,"PLEASE CONTINUE","record
inserted",JOptionPane.INFORMATION_MESSAGE);
details ob=new details();
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new fromto().setVisible(true);
}
})
package flightreservation;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class cancel extends javax.swing.JFrame {
Connection cn;
PreparedStatement st;
PreparedStatement st2;
Statement st1;
ResultSet rs;
ResultSet rs1;
int id=0;
public cancel() throws SQLException {
initComponents();
jLabel3.setVisible(false);
jLabel4.setVisible(false);
jLabel5.setVisible(false);
jLabel6.setVisible(false);
jLabel7.setVisible(false);
jLabel8.setVisible(false);
jLabel9.setVisible(false);
jLabel10.setVisible(false);
jLabel16.setVisible(false);
jLabel17.setVisible(false);
jLabel18.setVisible(false);
jLabel19.setVisible(false);
jLabel20.setVisible(false);
jLabel11.setVisible(false);
jLabel12.setVisible(false);
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
jLabel13.setVisible(false);
jLabel14.setVisible(false);
jLabel15.setVisible(false);
jButton1.setEnabled(false);
cn=DriverManager.getConnection("jdbc:derby://localhost:1527/flightreservation
","sahil","1776");
st1=cn.createStatement();
rs=st1.executeQuery("Select id from booking");
while(rs.next())
{
id=rs.getInt("id");
}
System.out.println(id);
}
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Installation/Deployment:
Once the software testing phase is over and no bugs or errors left in the system then the final
deployment process starts. Based on the feedback given by the project manager, the final
software is released and checked for deployment issues if any.
Maintenance:
Once the system is deployed, and customers start using the developed system, following 3
activities occur
Bug fixing - bugs are reported because of some scenarios which are not tested at all
Upgrade - Upgrading the application to the newer versions of the Software
Enhancement - Adding some new features into the existing software
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
DATABASE
ARCHITECTURE
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
The Database of ARS is designed in Apache Derby database as the default database for
the ARS. Basically ARS has two tables to handle various types of information as follows:
DBMS
Booking Registration
Field_Name Type
Firstname varchar
Lastname varchar
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Username varchar
Password varchar
Confirmpassword varchar
mobilenumber varchar
email varchar
REGISTERATION TABLE
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Field_Name Type
Id integer
from varchar
to varchar
date varchar
class varchar
adults varchar
children varchar
price integer
time varchar
name varchar
email varchar
method varchar
mobile varchar
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
Ticketed varchar
BOOKING TABLE
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
SCREENSHOTS
LOGIN MODULE:
In this module, user login with an username and password which he/she will get after registering
on MERI UDAAN
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
REGISTRATION MODULLE:
In this module,user have to provide his/her details as asked in the form for being a
part of MERI UDAAN
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
ROUTE MODULE:
This module gives information about the routes the MERI UDAAN serves
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
CONCLUSION
Though the system still containing lot of scope of improvement in it, but its overall look and feel
gives rough picture of on existing automation system.
At last we can declare that this system works properly and also gives you rough look and feel of
how an existing system on larger scale works.
The Airline reservation system a java project is not an exception. With working employees
traveling 24/7 this software speeds up your reservation process and makes it convenient for the
customers to book flights whenever and wherever! AIRLINE-RESERVATION-SYSTEM-A-
JAVA-PROJECT
It reduces the scope of manual error and conveniently maintains cancellations in the reservations.
It not only provides flight details but also but also creates a platform to book tickets,
cancellation.
This system is much fast in various queries and new registrations. You can register as new user
in this system by following all validations after that you can book your flight accordingly
Besides many good features, the system is also having some shortcomings like this system is not
properly on a big network. Anyway, I must expect that user will experience the good user
interface and I expect that my project is much sufficient to manage airline ticket booking
VOCATIONAL TRAINING ON AIRLINE RESRVATION SYSTEM
BIBLIOGRAPHY
• Class Notes
• Websites
1.www.tutorialspoint.com
2.www.stackoverflow.com
3.www.javatpoint.com