Вы находитесь на странице: 1из 80

Railway Reservation System

Chapter-1

1
Railway Reservation System

1.Introduction

Today one cannot afford to rely on the fallible human beings of be really wants to stand against today’s
merciless competition where not to wise saying “to err is human” no longer valid, it’s outdated to
rationalize your mistake. So, to keep pace with time, to bring about the best result without
malfunctioning and greater efficiency so to replace the unending heaps of flies with a much-
sophisticated hard disk of the computer. One has to use the data management software. Software has
been an ascent atomization various organization. Many software products working are now in markets,
which have helped in making the organizations work easier and efficiently. Data management initially
had to maintain a lot of ledgers and a lot of paper work has to be done but now software product on this
organization has made their work faster and easier. Now only this software has to be loaded on the
computer and work can be done. This prevents a lot of time and money. The work becomes fully
automated and any information regarding the organization can be obtained by clicking the button.
Moreover, now it’s an age of computers of and automating such an organization gives the better look.

1.1 Brief Project Description

2
Railway Reservation System

Admin has played vital role to create train schedule and make route, changes the train information as
per requirementadmin adds new train with train schedule and publish the offer special.

In this application one can visit the site and inquire the details about the information of train
schedule, fare details and can check the PNR status. He can print his ticket and cancel his ticket also.
Railway reservation in computer system is based on the ticket reservation in online with server
technology. A person reserves the ticket any where he/she present around the world.
Application based on server technology that means we can access any information about ticket
reservation in any server. We can get the information about the train time and about the confirmation
status of tickets. Both user and admin can access same information anywhere in this world.
Our application based on some module such as admin, passenger, train, facilities.

1) Admin
Admin can manage about the train time means like dispatch and arrival of train.
Admin can change and delete the route information about the train. He can manage the ticket means
ticket reservation, ticket canceling, manage the passenger module.

2) Passenger
Passenger can manage the passenger information means passenger details, and change
the passenger information and if suppose a passenger cancels the ticket the passenger information will
be deleted.
3) Train
Train module manages the train route, when a new train will start for journey the
information about the new train will be add in this module. Suppose a train get cancelled for journey
for any reason the information about that train will be deleted.
4) Facilities
Facilities module provides facilities such as the train seats, canteen with canteen staff, the electricity
facilities, the security of luggage.

3
Railway Reservation System

1. 2 OBJECTIVES OF PROPOSED SYSTEM

Today to keep pace with time, to bring about the best result without malfunctioning and greater
efficiency so to replace the unending heaps of flies with a much-sophisticated hard disk of the
computer. One has to use the data management software. Software has been an ascent in atomization to
various organizations. Many software products working are now in markets, which have helped in
making the organizations work easier and efficiently. Data management initially had to maintain a lot
of ledgers and a lot of paper work has to be done but now software product on this organization has
made their work faster and easier. Now only this software has to be loaded on the computer and work
can be done. This prevents a lot of time and money. The work becomes fully automated and any
information regarding the organization can be obtained by clicking the button. Moreover, now it’s an
age of computers of and automating such an organization gives the better look.

Now one can easily plan the journey comfortably as the process is efficient and fast with being easy to
access. Reservations can be made through the Indian railways
Site or at the ample reservation centers all over the country. Also, now there are authorized agencies
which provide reservation facility on behalf of India railways and without waiting in long line one can

4
Railway Reservation System

easily book a ticket. The booking is done through E-Ticket issues which have a PNR number of which
one has to take a print and just have to show at the station.
It not only reservation but cancellation can also be done through this system at ease and one can use a
credit card to complete the process.

Chapter 2

5
Railway Reservation System

2. HARDWARE & SOFTWARE INTERFACES:


Following software is used to develop a Web based application:
Operating System Windows 7 Professional
Environment Net Beans
Front End Tool Java 6
Technology J2EE
Backend Tool MYSQL
Data Access Tool JDBC
Railway Reservation System

HARDWARE INTERFACE

It’s a Web based application, so it required better configuration of Hardware. Hardware which is
required during development of an application:
Client Site:
Processor : Intel Pentium IV
Speed : 2.00GHz
RAM : 1 GB
Hard Disk : 150 GB
Key Board (104 keys) : Standard
Screen Resolution : 1024 x 768 Pixels
Server Site:
Processor : Intel Pentium IV
Speed : 2.00GHz
RAM : 1 GB
Hard Disk : 150 GB
Key Board (104 keys) : Standard
Screen Resolution : 1024 x 768 Pixels

2.1 PROGRAMMING LANGUAGE AND DEVELOPING TOOLS

HTML

HTML, initials of Hypertext Markup Language, is the predominant markup language for web
pages. It provides a means to describe the structure of text-based information in a document — by
denoting certain text as headings, paragraphs, lists, and so on — and to supplement that text with
interactive forms, embedded images, and other objects. HTML is written in the form of labels (known
as tags), surrounded by angle brackets. HTML can also describe, to some degree, the appearance and

7
Railway Reservation System

semantics of a document, and can include embedded scripting language code which can affect the
behavior of web browsers and other HTML processors.

HTML is also often used to refer to content of the MIME type text/html or even more broadly as a
generic term for HTML whether in its XML-descended form (such as XHTML 1.0 and later) or its
form descended directly from SGML

Hyper Text Markup Language

Hypertext Markup Language (HTML), the languages of the World Wide Web (WWW), allows users to
produces Web pages that include text, graphics and pointer to other Web pages (Hyperlinks).
HTML can be used to display any type of document on the host computer. It is a versatile language and
can be used on any platform or desktop.
HTML provides tags (special codes) to make the document look attractive. HTML tags are not case-
sensitive. Using graphics, fonts, different sizes, color, etc., can enhance the presentation of the
document.

Java Technology

Initially the language was called as “oak” but it was renamed as “Java” in 1995. The primary
motivation of this language was the need for a platform-independent (i.e., architecture neutral)
language that could be used to create software to be embedded in various consumer electronic devices.

 Java is a programmer’s language.


 Java is cohesive and consistent.
 Except for those constraints imposed by the Internet environment, Java gives the
programmer, full control.
 Finally, Java is to Internet programming where C was to system programming.

8
Railway Reservation System

Importance of Java to the Internet


Java has had a profound effect on the Internet. This is because; Java expands the Universe of objects
that can move about freely in Cyberspace. In a network, two categories of objects are transmitted
between the Server and the Personal computer. They are: Passive information and Dynamic active
programs. The Dynamic, Self-executing programs cause serious problems in the areas of Security and
probability. But, Java addresses those concerns and by doing so, has opened the door to an exciting new
form of program called the Applet.

Java can be used to create two types of programs


Applications and Applets : An application is a program that runs on our Computer under the
operating system of that computer. It is more or less like one creating using C or C++. Java’s ability to
create Applets makes it important. An Applet is an application designed to be transmitted over the
Internet and executed by a Java –compatible web browser. An applet is actually a tiny Java program,
dynamically downloaded across the network, just like an image. But the difference is, it is an intelligent
program, not just a media file. It can react to the user input and dynamically change.

Portability

For programs to be dynamically downloaded to all the various types of platforms connected to the
Internet, some means of generating portable executable code is needed. As you will see, the same
mechanism that helps ensure security also helps create portability. Indeed, Java’s solution to these two
problems is both elegant and efficient.

The Byte code

The key that allows the Java to solve the security and portability problems is that the output of Java
compiler is Byte code. Byte code is a highly optimized set of instructions designed to be executed by
the Java run-time system, which is called the Java Virtual Machine (JVM). That is, in its standard form,
the JVM is an interpreter for byte code.

Byte code helps JAVA much easier to run a program in a wide variety of environments. The reason is,
once the run-time package exists for a given system, any Java program can run on it.

9
Railway Reservation System

Although Java was designed for interpretation, there is technically nothing about Java that prevents on-
the-fly compilation of byte code into native code. Sun has just completed its Just In Time (JIT)
compiler for byte code. When the JIT compiler is a part of JVM, it compiles byte code into executable
code in real time, on a piece-by-piece, demand basis. It is not possible to compile an entire Java
program into executable code all at once, because Java performs various run-time checks that can be
done only at run time. The JIT compiles code, as it is needed, during execution.

Java Virtual Machine (JVM)

Beyond the language, there is the Java virtual machine. The Java virtual machine is an important
element of the Java technology. The virtual machine can be embedded within a web browser or an
operating system. Once a piece of Java code is loaded onto a machine, it is verified. As part of the
loading process, a class loader is invoked and does byte code verification makes sure that the code
that’s has been generated by the compiler will not corrupt the machine that it’s loaded on. Byte code
verification takes place at the end of the compilation process to make sure that is all accurate and
correct. So, byte code verification is integral to the compiling and executing of Java code.

Overall Description

Java byte
Java source code Java VM

.java .class

Java programming uses to produce byte codes and executes them. The first box indicates that the Java
source code is located in a. Java file that is processed with a Java compiler called javac. The Java
compiler produces a file called a. class file, which contains the byte code. The .Class file is then loaded
across the network or loaded locally on your machine into the execution environment is the Java virtual
machine, which interprets and executes the byte code.

Java Architecture

Java architecture provides a portable, robust, high performing environment for development. Java
provides portability by compiling the byte codes for the Java Virtual Machine, which is then interpreted

10
Railway Reservation System

on each platform by the run-time environment. Java is a dynamic system, able to load code when
needed from a machine in the same room or across the planet.

Compilation of code

When you compile the code, the Java compiler creates machine code (called byte code) for a
hypothetical machine called Java Virtual Machine (JVM). The JVM is supposed to execute the byte
code. The JVM is created for overcoming the issue of portability. The code is written and compiled for
one machine and interpreted on all machines. This machine is called Java Virtual Machine.
Compiling and interpreting Java Source Code

Java
PC Compiler Interpreter
Java
Source (PC)

Code
Macintosh Byte code Java
……….. Compiler Interpreter
(Platform
……….. (Macintosh)
Independent)
SPARC
Java
……….. Interpreter
Compiler
(Spare)

…………

During run-time the Java interpreter tricks the byte code file into thinking that it is running on a Java
Virtual Machine. In reality this could be a Intel Pentium Windows 7 or Sun SARC station running
Solaris or Apple Macintosh running system and all could receive code from any computer through
Internet and run the Applets.
Object-Oriented
Java was not designed to be source-code compatible with any other language. This allowed the Java
team the freedom to design with a blank slate. One outcome of this was a clean usable, pragmatic

11
Railway Reservation System

approach to objects. The object model in Java is simple and easy to extend, while simple types, such as
integers, are kept as high-performance non-objects.

Simple

Java was designed to be easy for the Professional programmer to learn and to use effectively. If you are
an experienced C++ programmer, learning Java will be even easier. Because Java inherits the C/C++
syntax and many of the object oriented features of C++. Most of the confusing concepts from C++ are
either left out of Java or implemented in a cleaner, more approachable manner. In Java there are a small
number of clearly defined ways to accomplish a given task.

Robust

The multi-platform environment of the Web places extraordinary demands on a program, because the
program must execute reliably in a variety of systems. The ability to create robust programs was given
a high priority in the design of Java. Java is strictly typed language; it checks your code at compile
time and run time.
Java virtually eliminates the problems of memory management and de-allocation, which is completely
automatic. In a well-written Java program, all run time errors can –and should –be managed by your
program

Java Database Connectivity

What Is JDBC?

JDBC is a Java API for executing SQL statements. (As a point of interest, JDBC is a trademarked name
and is not an acronym; nevertheless, JDBC is often thought of as standing for Java Database
Connectivity. It consists of a set of classes and interfaces written in the Java programming language.
JDBC provides a standard API for tool/database developers and makes it possible to write database
applications using a pure Java API.

12
Railway Reservation System

Using JDBC, it is easy to send SQL statements to virtually any relational database. One can write a
single program using the JDBC API, and the program will be able to send SQL statements to the
appropriate database. The combinations of Java and JDBC lets a programmer write it once and run it
anywhere.

What Does JDBC Do?

Simply put, JDBC makes it possible to do three things:


 Establish a connection with a database
 Send SQL statements
 Process the results.
JDBC versus ODBC and other APIs

At this point, Microsoft's ODBC (Open Database Connectivity) API is that probably the most widely
used programming interface for accessing relational databases. It offers the ability to connect to almost
all databases on almost all platforms. So why not just use ODBC from Java? The answer is that you can
use ODBC from Java, but this is best done with the help of JDBC in the form of the JDBC-
ODBCBridge, which we will cover shortly. The question now becomes "Why do you need JDBC?"
There are several answers to this question:

1. ODBC is not appropriate for direct use from Java because it uses a C interface. Calls from Java
to native C code have a number of drawbacks in the security, implementation, robustness, and
automatic portability of applications.
2. A literal translation of the ODBC C API into a Java API would not be desirable. For example,
Java has no pointers, and ODBC makes copious use of them, including the notoriously error-
prone generic pointer "void *". You can think of JDBC as ODBC translated into an object-
oriented interface that is natural for Java programmers.
3. ODBC is hard to learn. It mixes simple and advanced features together, and it has complex
options even for simple queries. JDBC, on the other hand, was designed to keep simple things
simple while allowing more advanced capabilities where required.
4. A Java API like JDBC is needed in order to enable a "pure Java" solution. When ODBC is used,
the ODBC driver manager and drivers must be manually installed on every client machine.

13
Railway Reservation System

When the JDBC driver is written completely in Java, however, JDBC code is automatically
installable, portable, and secure on all Java platforms from network computers to mainframes.
Two-tier and Three-tier Models. The JDBC API supports both two-tier and three-tier models for
database access. In the two-tier model, a Java applet or application talks directly to the database. This
requires a JDBC driver that can communicate with the particular database management system being
accessed. A user's SQL statements are delivered to the database, and the results of those statements are
sent back to the user. The database may be located on another machine to which the user is connected
via a network. This is referred to as a client/server configuration, with the user's machine as the client,
and the machine housing the database as the server. The network can be an Intranet, which, for
example, connects employees within a corporation, or it can be the Internet.

Java applet or
Client machine (GUI)
Html browser

HTTP, RMI, or CORBA calls

Application
Server (Java)
Server machine (business Logic)
JDBC DBMS-proprietary protocol

Database server

DBMS

JAVA
Client machine
Application

JDBC
DBMS-proprietary protocol

DBMS Database server


14
Railway Reservation System

JDBC-ODBC Bridge

If possible, use a Pure Java JDBC driver instead of the Bridge and an ODBC driver. This completely
eliminates the client configuration required by ODBC. It also eliminates the potential that the Java VM
could be corrupted by an error in the native code brought in by the Bridge (that is, the Bridge native
library, the ODBC driver manager library, the ODBC driver library, and the database client library).

What Is the JDBC-ODBC Bridge?

The JDBC-ODBC Bridge is a JDBC driver, which implements JDBC operations by translating them
into ODBC operations. To ODBC it appears as a normal application program. The Bridge
implements JDBC for any database for which an ODBC driver is available. The Bridge is
implemented as the

Sun.jdbc.odbc Java package and contains a native library used to access ODBC. The Bridge is a
joint development of Innersole and Java Soft.

JDBC connectivity

The JDBC provides database-independent connectivity between the J2EE platform and a wide range of
tabular data sources. JDBC technology allows an Application Component Provider to:

 Perform connection and authentication to a database server


 Manager transactions
 Move SQL statements to a database engine for preprocessing and execution
 Execute stored procedures
 Inspect and modify the results from Select statements
Database:

A database management system (DBMS) is computer software designed for the purpose of managing
databases, a large set of structured data, and run operations on the data requested by numerous users.
Typical examples of DBMSs include Oracle, DB2, Microsoft Access, Microsoft SQL Server, Firebird,
PostgreSQL, MySQL, SQLite, FileMaker and Sybase Adaptive Server Enterprise. DBMSs are typically
used by Database administrators in the creation of Database systems. Typical examples of DBMS use
include accounting, human resources and customer support systems.

15
Railway Reservation System

Originally found only in large companies with the computer hardware needed to support large data sets,
DBMSs have more recently emerged as a fairly standard part of any company back office.

Description

A DBMS is a complex set of software programs that controls the organization, storage, management,
and retrieval of data in a database. A DBMS includes:

 A modeling language to define the schema of each database hosted in the DBMS, according to the
DBMS data model.
 The four most common types of organizations are the hierarchical, network, relational and
object models. Inverted lists and other methods are also used. A given database management
system may provide one or more of the four models. The optimal structure depends on the
natural organization of the application's data, and on the application's requirements (which
include transaction rate (speed), reliability, maintainability, scalability, and cost).
 The dominant model in use today is the ad hoc one embedded in SQL, despite the
objections of purists who believe this model is a corruption of the relational model, since it
violates several of its fundamental principles for the sake of practicality and performance.
Many DBMSs also support the Open Database Connectivity API that supports a standard
way for programmers to access the DBMS.
 Data structures (fields, records, files and objects) optimized to deal with very large amounts of
data stored on a permanent data storage device (which implies relatively slow access compared
to volatile main memory).
 A database query language and report writer to allow users to interactively interrogate the
database, analyze its data and update it according to the user’s privileges on data.
 It also controls the security of the database.
 Data security prevents unauthorized users from viewing or updating the database. Using
passwords, users are allowed access to the entire database or subsets of it called
subschema's. For example, an employee database can contain all the data about an
individual employee, but one group of users may be authorized to view only payroll data,
while others are allowed access to only work history and medical data.
 If the DBMS provides a way to interactively enter and update the database, as well as
interrogate it, this capability allows for managing personal databases. However, it may not
leave an audit trail of actions or provide the kinds of controls necessary in a multi-user

16
Railway Reservation System

organization. These controls are only available when a set of application programs are
customized for each data entry and updating function.
 It also maintains the integrity of the data in the database.
 The DBMS can maintain the integrity of the database by not allowing A transaction mechanism,
that ideally would guarantee the ACID properties, in order to ensure data integrity, despite
concurrent user accesses (concurrency control), and faults (fault tolerance).
 more than one user to update the same record at the same time. The DBMS can help prevent
duplicate records via unique index constraints; for example, no two customers with the same
customer numbers (key fields) can be entered into the database. See ACID properties for
more information (Redundancy avoidance).

The DBMS accepts requests for data from the application program and instructs the operating system
to transfer the appropriate data.

When a DBMS is used, information systems can be changed much more easily as the organization's
information requirements change. New categories of data can be added to the database without
disruption to the existing system.

Organizations may use one kind of DBMS for daily transaction processing and then move the detail
onto another computer that uses another DBMS better suited for random inquiries and analysis. Overall
systems design decisions are performed by data administrators and systems analysts. Detailed database
design is performed by database administrators.

Database servers are specially designed computers that hold the actual databases and run only the
DBMS and related software. Database servers are usually multiprocessor computers, with RAID disk
arrays used for stable storage. Connected to one or more servers via a high-speed channel, hardware
database accelerators are also used in large volume transaction processing environments.

DBMSs are found at the heart of most database applications. Sometimes DBMSs are built around a
private multitasking kernel with built-in networking support although nowadays these functions are left
to the operating system.

Chapter-3

17
Railway Reservation System

18
Railway Reservation System

3.SYSTEM ANALYSIS

System development can generally be thought of having two major components: systems analysis and
systems design. In System Analysis more emphasis is given to understanding the details of an existing
system or a proposed one and then deciding whether the proposed system is desirable or not and
whether the existing system needs improvements. Thus, system analysis is the process of investigating
a system, identifying problems, and using the information to recommend improvements to the system.
Systems are created to solve problems. One can think of the systems approach as an organized way of
dealing with a problem. In this dynamic world, the subject System Analysis and Design, mainly deals
with the software development activities. Systems analysis is the interdisciplinary part of science,
dealing with analysis of sets of interacting entities, the systems, often prior to their automation as
computer systems, and the interactions within those systems. This field is closely related to operations
research. It is also "an explicit formal inquiry carried out to help someone, referred to as the decision
maker, identify a better course of action and make a better decision than he might have otherwise made.

Computers are fast becoming our way of life and one cannot imagine life without computers in today’s
world. You go to a railway station for reservation, you want to web site a ticket for a cinema, you go to
a library, or you go to a bank, you will find computers at all places. Since computers are used in every
possible field today, it becomes an important issue to understand and build these computerized systems
in an effective way.
Building such systems is not an easy process but requires certain skills and capabilities to understand
and follow a systematic procedure towards making of any information system. For this, experts in the
field have devised various methodologies. Waterfall model is one of the oldest methodologies. Later

19
Railway Reservation System

Prototype Model, Object Oriented Model, Dynamic Systems Development Model, and many other
models became very popular for system development. For anyone who is a part of this vast and
growing Information Technology industry, having basic understanding of the development process is
essential. For the students aspiring to become professionals in the field a thorough knowledge of these
basic system development methodologies is very important.

The very first thing is problem identification. After the need of the project is identified the
implementation of the project is identified who is going to use the websites, what all are the points
needed in modeling the design of the website.

What is System?
In the broad sense, a system is simply a set of components that interact to accomplish some
purpose. A system is a collection of elements or components that are organized for a common purpose.
The word sometimes describes the organization or plan itself (and is similar in meaning to method) and
sometimes describes the parts in the system (as in "computer system").
A computer system consists of hardware components that have been carefully chosen so that they work
well together and software components or programs that run in the computer.
The main software component is itself an operating system that manages and provides services to other
programs that can be run in the computer.
 A group of interdependent items that interact regularly to perform a task.
An established or organized procedure; a method.
 A computer system refers to the hardware and software components that run a computer or
computers.
 An information system is a system that collects and stores data.
 System often simply refers to the operating system.

Different situations are represented by three distinct approaches to the development of computer
information system:

 System Development Life Cycle


 Structured Analysis Development Method
 System Prototype Meth

20
Railway Reservation System

3.1 IDENTIFICATION OF NEED

Journey by rail has its own charm and glitz in India. And, railway reservation in India is no more a
hassle nowadays. You can go by online train reservation services or any outlet for that matter. Despite
the coming up of cheap fairs in domestic airlines market, a substantial number of passengers and
visitors’ journey by train. However, a train travel is both safe & comfortable and cheap. Indian people
like to travel by train and tourists prefer luxury trains. A journey by train takes you to unearth the
otherwise unexplored sites and mysteries of Mother India. As far as the railway reservation in India is
concerned, there are myriad options at one’s disposal. You can go by online train reservation system or
any railway reservation booking outlet scattered everywhere. There many Indian websites now
available with Trains Time Table.

However, Indian railway ticket reservation is no more a hassle some job. Just lay your hands on any
railway reservation booking outlet around you and make your way to the differing journey. With the
onset of online railway reservation system things got much simpler for the passengers to book railway
tickets online.
Indian railways are working incessantly to endow simply the best services to the passengers in India.
Anyone with a system can have rail reservation instantly with no hassle. However, there are also
systems of making railway reservation enquiry from virtually any place with your computer. This is
how the whole system of booking railway tickets got easier in terms of accessibility and affordability.
You are no longer required to sweat and fret over online train ticket reservation in India. For any
inquiry or for that matter any info you require regarding railway reservations just log onto the official
site of Indian railways and you will have it.

Sitting at your home in front of a computer can give you all the relevant information on booking tickets
in Indian railways. Booking any train on Indian Railways computerized passenger reservation system
(PRS) network from any originating station or train passing through source station to any destination.

3.2 PRELIMINARY INVESTIGATION

21
Railway Reservation System

The first phase of the system development life cycle is preliminary investigation. Due to limited
resources an organization can undertake only those projects that are critical to its mission, goals and
objectives. Therefore, the goal of preliminary investigation is simply to identify and select a project for
development from among all the projects that are under consideration. Organization may differ in how
they identify and select projects for development. The objective of system-investigation phase is to
answer the following question: What is the business? Is it a problem or opportunity? What are the
major causes of the problem? Can a problem be solved by improving the current information system?
Is a new information system needed?

First stage is the preliminary analysis. The main aim of preliminary analysis is to identify the problem.
First, need for the new or the enhanced system is established. Only after the recognition of need, for the
proposed system is done then further analysis is possible.

Suppose in an office all leave-applications are processed manually. Now this company is recruiting
many new people every year. So, the number of employees in the company has increased. So manual
processing of leave application is becoming very difficult. So the management is considering the option
of automating the leave processing system. If this is the case, then the system analyst would need to
investigate the existing system, find the limitations present, and finally evaluate whether automating
the system would help the organization.

This is the first phase and consists of a brief survey of the areas involved and will result in taking the
project into the next phase, postponing development for a period or recommending that no further
action be taken. The phase is initiated by management, who perceive the need because of changes or
expected changes in the business environment, limitations or failure of existing systems, or the
awareness of technological advances relating to the particular are involved in particular systems which
competitors are developing.

When the request is made, the first systems activity, the preliminary investigation, begins. The activity
has three parts: request clarification, feasibility study and request approval.
The objective of the system- investigation phase is to answer the following questions:

22
Railway Reservation System

 What is business problem?


 Major cause of problem.
 Can the problem be solved by improving the current information system?
 Is a new information system needed?
 Give the information based on project size, costs and potential benefits.

Preliminary Investigation of Railway Reservation System


In the case of construction of new trains and routes a preliminary investigation should be undertaken by
the Railway Administration concerned to determine how the proposed routes and trains will fit in with
the general scheme of future railway development. The preliminary investigation should be based on a
careful study of information already available from existing maps, published figures of trade and
population of the area to be served and financial and statistical data of existing railways in similar
country.

23
Railway Reservation System

3.3 FEASIBILITY STUDY

A feasibility study is an evaluation of a proposal designed to determine the difficulty in carrying out a
designated task. Generally, a feasibility study precedes technical development and project
implementation. In other words, a feasibility study is an evaluation or analysis of the potential impact
of a proposed project. A feasibility study looks at the viability of an idea with an emphasis on
identifying potential problems and attempts to answer one main question: Will the idea work and
should you proceed with it? A Project Feasibility Study is an exercise that involves documenting each
of the potential solutions to a particular business problem or opportunity. Feasibility Studies can be
undertaken by any type of business, project or team and they are a critical part of the Project Life
Cycle.

At this stage the client’s business needs are analyzed, information about project participants is
collected, and the requirements for the system are gathered and analyzed. The client’s expectations for
system implementation are studied and the proposed solution is offered. During the Feasibility Study
stage, the project’s goals, parameters and restraints are agreed upon with the client including:

 Project budget and rules for its adjustment;


 Project time frame;

 Conceptual problem solution.

The purpose of a Feasibility Study is to identify the likelihood of one or more solutions meeting the
stated business requirements. In other words, if you are unsure whether your solution will deliver the
outcome you want, then a Project Feasibility Study will help gain that clarity. During the Feasibility
Study, a variety of 'assessment' methods are undertaken. The outcome of the Feasibility Study is a
confirmed solution for implementation.

24
Railway Reservation System

25
Railway Reservation System

FIVE COMMON FACTORS:

 Technology and system feasibility

The assessment is based on an outline design of system requirements in terms of Input, Processes,
Output, Fields, Programs, and Procedures. This can be quantified in terms of volumes of data, trends,
frequency of updating, etc. in order to estimate whether the new system will perform adequately or not.
Technological feasibility is carried out to

determine whether the company has the capability, in terms of software, hardware, personnel and
expertise, to handle the completion of the project.

 Economic feasibility:

Economic analysis is the most frequently used method for evaluating the effectiveness of a new system.
More commonly known as cost/benefit analysis, the procedure is to determine the benefits and savings
that are expected from a candidate system and compare them with costs. If benefits outweigh costs,
then the decision is made to design and implement the system. An entrepreneur must accurately weigh
the cost versus benefits before taking an action.

 Cost Based Study:

It is important to identify cost and benefit factors, which can be categorized as follows: 1. Development
costs; and 2. Operating costs. This is an analysis of the costs to be incurred in the system and the
benefits derivable out of the system.

 Time Based Study:

This is an analysis of the time required to achieve a return on investments. The benefits derived from
the system. The future value of a project is also a factor.

 Legal feasibility:

26
Railway Reservation System

Determines whether the proposed system conflicts with legal requirements, e.g. a data processing
system must comply with the local Data Protection Acts.

 Operational feasibility:

Is a measure of how well a proposed system solves the problems, and takes advantages of the
opportunities identified during scope definition and how it satisfies the requirements identified in the
requirements analysis phase of system development?

 Schedule feasibility:

A project will fail if it takes too long to be completed before it is useful. Typically, this means
estimating how long the system will take to develop, and if it can be completed in a given time period
using some methods like payback period. Schedule feasibility is a measure of how reasonable the
project timetable is. Given our technical expertise, are

The project deadlines reasonable? Some projects are initiated with specific deadlines. You need to
determine whether the deadlines are mandatory or desirable.

Why Are Feasibility Studies so Important?

The information you gather and present in your feasibility study will help you:

 List in detail all the things you need to make the business work;
 Identify logistical and other business-related problems and solutions;

 Develop marketing strategies to convince a bank or investor that your business is worth
considering as an investment; and

 Serve as a solid foundation for developing your business plan.

The following tasks are performed at this stage:

 The project feasibility is estimated and the project scope is defined;


 Risks and benefits are identified;

27
Railway Reservation System

 The project structure is elaborated;

 The project is roughly planned;

 The next project stage is planned precisely;

 Cost of the next phase is evaluated precisely and cost of the other phases — approximately;

 Functionality development priorities are defined;

 System creation risks are estimated.

At the end of this phase the following documents are available:

 Feasibility Report — description of the proposed solution and list of high-level functional
requirements;
 Project Structure — description of the project organization;

 Project Plan — project schedule;

 Risks List — list of potential project risks and possibilities of their elimination.

28
Railway Reservation System

29
Railway Reservation System

3.4 SOFTWARE REQUIREMENT SPECIFICATION

An SRS is basically an organization's understanding (in writing) of a customer or potential client's


system requirements and dependencies at a particular point in time (usually) prior to any actual design
or development work. It's a two-way insurance policy that assures that both the client and the
organization understand the other's requirements from that perspective at a given point in time. The
SRS document itself states in precise and explicit language those functions and capabilities a software
system (i.e., a software application, an ecommerce Web site, and soon) must provide, as well as states
any required constraints by which the system must abide. The SRS also functions as a blueprint for
completing a project with as little cost growth as possible. The SRS is often referred to as the "parent"
document because all subsequent project management documents, such as design specifications,
statements of work, software architecture specifications, testing and validation plans, and
documentation plans, are related to it. It's important to note that an SRS contains functional and
nonfunctional requirements only; it doesn't offer design suggestions, possible solutions to technology
or business issues, or any other information other than what the development team understands the
customer's system requirements to be. A well-designed, well-written SRS accomplishes four major
goals:
 It provides feedback to the customer. An SRS is the customer's assurance that the development
organization understands the issues or problems to be solved and the software behavior
necessary to address those problems. Therefore, the SRS should be written in natural language
(versus a formal language, explained later in this article), in an unambiguous manner that may
also include charts, tables, data flow diagrams, decision tables, and so on.
 It decomposes the problem into component parts. The simple act of writing down software
requirements in a well-designed format organizes information, places borders around the
problem, solidifies ideas, and helps break down the problem into its component parts in an
orderly fashion.

 It serves as an input to the design specification. As mentioned previously, the SRS serves as the
parent document to subsequent documents, such as the software design specification and

30
Railway Reservation System

statement of work. Therefore, the SRS must contain sufficient detail in the functional system
requirements so that a design solution can be devised.

 It serves as a product validation check. The SRS also serves as the parent document for testing
and validation strategies that will be applied to the requirements for verification.

3.4.1 SRS for RAILWAY RESERVATION SYSTEM

P0: Railway Reservation System Website


Input for Admin: Admin info, Train name and Train Type, Station Code and Fare info.
Output for Admin: Feedback of User

Input for User: View required info about required Train.


Output for User: Details about Source station, Destination station, Train time, Seat
Availability.
Processing: for valid entry of Admin information is stored in the table otherwise error
message will be displayed. For valid request of user information is
retrieved from the table and shown to the user otherwise error message
will be displayed.

P1: Open Website


Input: URL
Output: Admin gets login page and user enter in the Home Page.
Processing: For valid URL page opens otherwise error message will be displayed.
Processes for Admin

P2: Admin Login


Input: Id and Password
Output: Admin enter in the Master page.
Processing: For valid Id and Password page opens otherwise Error message will be
displayed.

31
Railway Reservation System

P3: Admin detail info.


Input: Admin details.
Output: Details of admin will be shown.
Processing: Details of admin will be stored in the table

P4: Customer Details entry


Input: Customer Information
Output: Details of customer will be shown.
Processing: Details of customer will be stored in the table

P5: Train Details entry


Input: Train Information
Output: Details of Train will be shown.
Processing: Details of Train will be stored in the table

Processes for User

P6: View info, View PNR Status.


Input: Source Station, Destination Station, Train No/Name, Journey Date, Class.
Output: Train details will be displayed.
Processing: for valid Train No/Name, PNR No, Journey date, Seat/Berth No will be
displayed otherwise Error message will be displayed.

P7: Reservation

P7.1 View Train Info


Input: Train No/Name, Class Type, Train Type options.
Output: Details of required train will be displayed to user.
Processing: Retrieving the information of Train from the provided request.

32
Railway Reservation System

P7.2 Reservation
Input: Source Station, Destination Station, Journey Date, Class Type.
Output: Seat/ Berth no issued, PNR no.
Processing: With the requested details Ticket will be issued.

P8: Feedback Form


Input: “Feedback” option.
Output: A page will open contains from for filling feedback details.
Processing: Feedback of User stored in the feedback table.

SOFTWARE ENGINEERING PARADIGM APPLIED

3.5 SYSTEM DEVELOPMENT LIFE CYCLE

33
Railway Reservation System

Phases of System Development Life Cycle

SDLC process stats from conception to completion of any software project. According to this approach
the software development team is responsible for the whole project development life cycle. After doing
SRS and requirements analysis; developers follow different models of Software development Life
Cycle (SDLC) available, while the most common model is SDLC waterfall model. They divide project
in different stages & phases and the output of each stage or phase becomes the input for next stage.
Prototyping is an iterative process that is part of the system or project analysis phase of the system
development life cycle. Under prototyping the user’s feedback required to take from a developing
physical system. This helps system analysts to develop the initial set of SRS (System Requirement and
Specification).

The Traditional SDLC Phases or Stages:


Project feasibility study: Under this phase the software analysts and strategy makers establish a
descriptive view of the intended project and determine its goals & objectives.
Requirement specifications: Under this phase analysts refines project goals into defined functions and
operation of the intended software application.
System analysis: Under this phase analysts analyze the end-user information needs and prepare a solid
plan.
Systems design: Now the software development team describes desired features, functionalities and
operations in detail, including SDLC process & screen layouts, business rules & standards, process
diagrams & DFD, pseudo-code and related documentation.
Implementation/ coding/ development: Under this phase the actual code is written. They divide the
work in distributed fashion and assign it to the particular specialized team member.
Integration and testing: Under this phase developers integrate all the modules together into a single
system for special testing cases and maintenance to check errors, bugs and interoperability as per
standard testing methods.
Acceptance, installation, deployment: This is the final stage of SDLC life cycle. The development
team puts the compiled software onto end-user unit or interface and runs targeted business.

34
Railway Reservation System

Maintenance: Under this phase or stage any changes, correction, additions, inter platform movement
or say migration and porting and many more. It is the least glamorous and perhaps most important step
of all, goes forever during whole system life.

Software Engineering Paradigms:


To solve actual problems in a software project setting, a software engineer or a team of engineers must
incorporate a development strategy that includes methods, tools and procedures. This strategy is
referred to as a process model or a software engineering paradigm.
There are several such paradigms available. Which software paradigm is more suitable depends on lot
of factors such as:
 Nature of the Project
 Type of Applications
 Tools proposed to be used
 Kind of controls and documentation required.

The different software engineering paradigms are: -

 Waterfall model
 Prototyping model.
 Object oriented model
 Spiral model
 WINWIN spiral model
 Incremental model
 Evolutionary model

The simplest, oldest and most widely used process model for software designing is the waterfall model.
It was proposed by Royce in 1970.
The essence of this software paradigm is that the process of software designing consists of linear set of
distinct phases.
These phases are:

35
Railway Reservation System

Feasibility Study
Stage1:
The goal of feasibility study is to evaluate alternative systems and to purpose the most feasible and
desirable system for designing. Five types of feasibility are addressed in this study.
 Technical feasibility
 Economic Feasibility
 Motivational Feasibility
 Schedule Feasibility
 Operational Feasibility

Stage2: Requirement Analysis and Specification


The goal of this phase is to understand the exact requirements of the customers and to document them
properly. This activity is usually executed together with the customers, as the goal is to document all
functions, performance and interfacing requirements for the software designing and management. The
requirements describe “what” of a system. This phase produces a large document containing a
description of what the system will do without describing how it will be done. This document is known
as software requirement specification (SRS) document.

Stage3: Design
The goal of this phase is to transform the requirement specification produced in the requirement
analysis phase into a structure that is suitable for implementation in some programming language,
Here, overall software architecture is defined, and the product design and detailed design work is
performed. This work is documented and is known as software design description (SDD document).

36
Railway Reservation System

Stage4: Coding and Unit Testing


The information contained in SDD is sufficient to begin the coding Phase. The coding Phase of
software designing involves translation of design specification into a machine readable form. If design
is performed in a detailed manner, code generation can be accomplished easily. This phase is also
known as the implementation phase. Here, each component of the design is implemented as a program
module, and each of these program modules is unit tested. The purpose of unit testing is to determine
the correct working of individual modules.

Stage5: Integration and System Testing:


During this phase the different program modules are integrated in a planned way and then tested as a
completed system to ensure that the designed system functions according to its requirements as
specified in the SRS document. After testing, the software is delivered to the customer.

Stage6: Software Maintenance


This is the last phase of software designing which includes a broad set of activities such as error
correction, enhancement of capabilities, deletion of obsolete capabilities and optimization.

37
Railway Reservation System

38
Railway Reservation System

3.6 DATA FLOW DIAGRAM

Data flow diagrams are used to describe how the system transforms information. They define how
information is processed and stored and identify how the information flows through the processes.
When building a data flow diagram, the following items should be considered:
 Where does the data that passes through the system come from and where does it go,
 What happens to the data once it enters the system (i.e., the inputs) and before it leaves
the system (i.e., the outputs),
 What delays occur between the inputs and outputs (i.e., identifying the need for data
stores?)
In the DFD, there are four symbols:
 A square defines a source (originator) or destination of system data
 An arrow identifies data flow. It is the pipeline through which the information flows
 A circle or a bubble represents a process that transforms incoming data flow into
outgoing data flows.
 An open rectangle is a data store, data at rest or a temporary repository of data

Process
A process transforms incoming data flow into outgoing data flow.

Yourdon and Coad Process Notations

39
Railway Reservation System

Gane and Sarson Process Notation

Data Store
Data Store is repositories of data in the system. They are sometimes also referred to as files.

Yourdon and Coad Datastore Notations

Gane and Sarson Datastore Notations

Dataflow Notations
Dataflow are pipelines through which packets of information flow. Label the arrows with the name of
the data that moves through it.

External Entity Notations


40
Railway Reservation System

External entities are objects outside the system, with which the system communicates. External entities
are sources and destinations of the system's inputs and outputs.

Context Flow Diagram - 0 DFD

41
Railway Reservation System

Level 1

42
Railway Reservation System

Level 2

Id/pwd

store store

43
Railway Reservation System

3.7 ENTITY RELATIONSHIP DIAGRAM

An entity-relationship (ER) diagram is a specialized graphic that illustrates the interrelationships


between entities in a database. ER diagrams often use symbols to represent three different types of
information. Boxes are commonly used to represent entities. Diamonds are normally used to represent
relationships and ovals are used to represent attributes.

It is also known as ER Diagram, E-R Diagram, entity-relationship model.


Basic E-R Notation

Strong entity Attribute

Weak Entity Relationship

Identifying Relationship Multivalued Attribute

Derived attribute

44
Railway Reservation System

45
Railway Reservation System

46
Railway Reservation System

3.8 USE CASE DIAGRAM

A use case in software engineering and systems engineering is a description of a system’s behavior as it
responds to a request that originates from outside of that system. In other words, a use case describes
"who" can do "what" with the system in question. The use case technique is used to capture a system's
behavioral requirements by detailing scenario-driven threads through the functional requirements.

USE Case Notation:

Use Case A Use Case is a kind of behavior classifier, which represents a


declaration of an offered behavior.

Use
case

Actor specifies a role played by human users, external hardware,


Actor
or other subjects that interacts with the subject.

System System represents the boundary of the subject.


System

47
Railway Reservation System

48
Railway Reservation System

CHAPTER-4

System Design Diagram


4. SYSTEM DESIGN

49
Railway Reservation System

4.1 Modularization Detail

50
Railway Reservation System

ADMIN Detail:

Class Master: This is an admin part in which an admin can make an entry about all the classes of train
Like Sleeper, First AC, Second AC, Third Ac, General, and Chair Cart.

Quota: Here the Admin enters the information about Quota which is applicable for certain kind of
people. This includes general quota which is applicable for all level of passengers, Ladies Quota which
is applicable for only ladies, Physically Handicapped, Senior citizen quota which is for the passenger
whose age is above 60 years and Child quota is for children who is below 12 years of age.

Concessional fair: Here the Admin provide a concession to particular category of passenger for Child
there is 50% concession, Ladies 30% concession, Senior Citizen 60% concession, Physically
Handicapped 40%.

Discount: It depends on the quota like ladies, child, physically handicapped, senior citizen. According
to the quota different rate of discount is applicable.

Route: Here the admin check for different routes of different trains. Which train passes via which
route? Here fields also contain information about source station, destination station, and train no.

Journey: Here the admin enters details about Train no, Station code and Journey days on a particular
day which train run from source to destination station.

Seat Arrangement: Here the admin enter details about Train no/name. Enter details for different type
of berth, coach type and limited details of seat. In each coach there is limited number of seats available.

Train No/Name/Type: Here the admin makes a difference between different types of train like
Shatabdi express, Rajdhani express, Mail, Superfast, Passenger. Each train is identified by unique train
no.

Station: Each station has its own unique code and Station name.

51
Railway Reservation System

Feedback: Admin checks the feedback which is submitted by the user through feedback form and
according to this feedback, admin send reply to the user.
User Detail:

PNR Status: Here user enter the PNR number which is issued to the passenger after reservation and
according to this PNR number user get information about seat/berth and status of ticket.

Train between Stations: Here user enter source and destination station name, Journey date and class
name and according to the request user get to know about the different train ant their availability.

Fare inquiry: On the basis of train no, type of class in each train, source and destination station an
applicable fare rate is calculated.

Registration Form: If a user wants to book a ticket then the user has to fill the details for register like
name, address, phone, email id, gender, date of birth etc

Login: A registered user can only be able to login with a provided user id and password to book a ticket
else has to register.

Feedback: If a user face any problem during booking a ticket and want some more information then to
fill a form with name, email id, phone no, query and submit it.

4.2 Data Integrity and Constraints

It is important feature in SQL server. When used popularly, it ensures that data is accurate, correct and
valid. It also acts as a trap for otherwise undetectable bugs within application. A constraint is a property
assigned to a column or set of the columns in a table that prevents certain type of inconsistencies data
values from being placed in a column(s). Constraints are used to enforce the data integrity. This ensures
the accuracy and reliability of the data in the database.

52
Railway Reservation System

The following categories of the data integrity exists: -

 Entity Integrity: - Entity integrity ensures that there are no duplicate rows in a table.
 Domain Integrity: - Domain Integrity enforce valid entries for a given column by restricting

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


 Referential Integrity: - Referential Integrity ensures that rows cannot be deleted, which is
used by other records (for example, corresponding data values between tables will be vital).
 User-Defined Integrity: - User-Defined Integrity enforces some specific business rules that do
not fall into entity, domain, or referential integrity categories.
Each of these categories of the data integrity can be enforced by the appropriate constraints.
Microsoft SQL Server supports the following constraints: -

Primary key: Primary key constraint is a unique identifier for a row within a database table. Every
table should have a primary key constraint to uniquely identify each row and only one primary kay
constraint can be created for each table. The primary key constraint are used to enforce entity integrity.

Unique: Unique constraint enforce the uniqueness of the values in a set of columns, so no duplicate
values are entered. The unique key constraints are used to enforce entity integrity as the primary key
constraints.

Foreign Key: A foreign key (FK) is a column or combination of columns that is used to establish and
enforce a link between the data in two tables.

Check: CHECK constraints enforce domain integrity by limiting the values that are accepted by a
column. They are similar to FOREIGN KEY constraints in that they control the values that are put in a
column.

NULL: The NOT NULL constraint enforces a field to always contain a value. This means that you
cannot insert a new record, or update a record without adding a value to this field.

53
Railway Reservation System

5.3 Data Dictionary

A data dictionary is a collection of descriptions of the data objects or items in a data model for the
benefit of programmers and others who need to refer to them. A first step in analyzing a system of
objects with which users interact is to identify each object and its relationship to other objects. This
process is called data modeling and results in a picture of object relationships. After each data object or
item is given a descriptive name, its relationship is described (or it becomes part of some structure that
implicitly describes relationship), the type of data (such as text or image or binary value) is described,
possible predefined values are listed, and a brief textual description is provided. This collection can be
organized for reference into a book called a data dictionary.

admin

Coach details

fare info

54
Railway Reservation System

reg

Res add

55
Railway Reservation System

ticket info

train details

waiting list

56
Railway Reservation System

57
Railway Reservation System

Chapter 5

58
Railway Reservation System

DESIGN PATTERN USED:

Servlet

Servlet can be described in many ways, depending on the context.Servlet

is a technology i.e. used to create web application.Servlet is an API that

provides many interfaces and classes including documentations.Servlet is an interface that must
be implemented for creating any servlet.Servlet is a class that extend the capabilities of the
servers and respond to the incoming request. It can respond to any type of requests.

Servlet is a web component that is deployed on the server to create dynamic web page.

59
Railway Reservation System

JSP

Java Server Pages (JSP) is a server-side programming technology that enables the
creation of dynamic, platform-independent method for building Web-based
applications. JSP have access to kthe entire family of Java APIs, including the JDBC
API to access enterprise databases. This tutorial will teach you how to use Java Server
Pages to develop your web applications in simple and easy steps.

Process flow:

Web.xml: Whenever the container gets start up the first work it does is to check the web.xml
file and determine what struts action Servlets exist. The container is responsible for mapping all
the file request to the correct action Servlet.

A Request: This is the second step performed by the container after checking the web.xml
file. In this the user submits a form within a browser and the request is intercepted by the
controller.

60
Railway Reservation System

The Controller: This is the heart of the container. Most Struts application will have only one
controller that is Action Servlet which is responsible for directing several Actions. The
controller determines what action is required and sends the information to be processed by an
action Bean. The key advantage of having a controller is its ability to control the flow of logic
through the highly controlled, centralized points.

Struts-config.xml: Struts has a configuration file to store mappings of actions. By using this
file there is no need to hard code the module which will be called within a component. The one
more responsibility of the controller is to check the struts.config.xml file to determine which
module to be called upon an action request. Struts only reads the struts.config.xml file upon
start up.

Model: The model is basically a business logic part, which takes the response from the user
and stores the result for the duration of the process. This is a great place to perform the
preprocessing of the data received from request. It is possible to reuse the same model for many
page requests. Struts provide the Action Form and the Action classes, which can be extended to
create the model objects.

View: The view in struts framework is mainly a jsp page, which is responsible for producing
the output to the user. Through the view Layer the user will interact with the System.

Struts tag libraries: These are struts components helps us to integrate the struts framework
within the project's logic. These struts tag libraries are used within the JSP page. This means
that the controller and the model part can't make use of the tag library but instead use the struts
class library for strut process control.

Property file: It is used to store the messages that an object or page can use. Properties files
can be used to store the titles and other string data. We can create many property files to handle
different languages. Business objects: It is the place where the rules of the actual project exist.
These are the modules that just regulate the day- to- day site activities.

The Response: This is the output of the View JSP object.

61
Railway Reservation System

System Design

Data Integrity and Constraints


It is important feature in SQL server. When used popularly, it ensures that data is accurate, correct and
valid. It also acts as a trap for otherwise undetectable bugs within application. A constraint is a property
assigned to a column or set of the columns in a table that prevents certain type of inconsistencies data
values from being placed in a column(s). Constraints are used to enforce the data integrity. This ensures
the accuracy and reliability of the data in the database.
The following categories of the data integrity exists: -
 Entity Integrity: - Entity integrity ensures that there are no duplicate rows in a table.
 Domain Integrity: - Domain Integrity enforce valid entries for a given column by restricting
the type, the format, or the range of possible values.
 Referential Integrity: - Referential Integrity ensures that rows cannot be deleted, which is
used by other records (for example, corresponding data values between tables will be vital).
 User-Defined Integrity: - User-Defined Integrity enforces some specific business rules that do
not fall into entity, domain, or referential integrity categories.
Each of these categories of the data integrity can be enforced by the appropriate constraints.
Microsoft SQL Server supports the following constraints: -
Primary key: Primary key constraint is a unique identifier for a row within a database table.
Every table should have a primary key constraint to uniquely identify each row and only one
primary key constraint can be created for each table. The primary key constraint are used to
enforce entity integrity.
Unique: Unique constraint enforce the uniqueness of the values in a set of columns, so no duplicate
values are entered. The unique key constraints are used to enforce entity integrity as the primary key
constraints.
Foreign Key: A foreign key (FK) is a column or combination of columns that is used to establish and
enforce a link between the data in two tables.
Check: CHECK constraints enforce domain integrity by limiting the values that are accepted by a
column. They are similar to FOREIGN KEY constraints in that they control the values that are put in a
column.

62
Railway Reservation System

CHAPTER-6

Home Page

63
Railway Reservation System

Login Page

64
Railway Reservation System

Change password Page

Search Train Page

65
Railway Reservation System

Fare Enquiry Page

Pnr Status

66
Railway Reservation System

Train Details

67
Railway Reservation System

Coach_Details

Fair Details

68
Railway Reservation System

Waiting Info

CHAPTER-7

69
Railway Reservation System

7. CODING

Code Optimization
Optimization is the process of transforming a piece of code to make more efficient
(either in terms of time or space) without changing its output or side-effects. The only
difference visible to the code’s user should be that it runs faster and/or consumes less
memory. It is really a misnomer that the name implies you are finding an "optimal"
solution— in truth, optimization aims to improve, not perfect, the result.
What is improved in the optimization?
 Space optimizations - Reduces the size of the executable/object.
Constant pooling
Dead-code elimination.

70
Railway Reservation System

 Speed optimizations - Most optimizations belong to this category

The degradation from inefficient use of memory is much greater than that from inefficient use of the
caches, because the difference in speed between memory and disk is much higher than between cache
and memory.
Code-optimization techniques include the following:
 To minimize the code working set of a program, pack frequently executed code together, while
separating infrequently used code. In other words, do not put long blocks of error handling
code in line and load frequently called modules next to their callers.
 To minimize the data working set, concentrate frequently used data together and avoid
unnecessary references to pages.
 To minimize pinned storage, package pinned code in separate load modules. Make sure it is
necessary to use pinned code. Certain system structures (such as mbuf pools) are pinned in
memory; do not arbitrarily increase them.
 Real-time techniques can be used, such as the plock() subroutine to pin code in memory, and
priorities pinned with the setpri() subroutine.

When and Where To Optimize?


There are a variety of tactics for attacking optimization. Some techniques are applied to
the intermediate code, to streamline, rearrange, compress, etc. in an effort to reduce the
size of the abstract syntax tree or shrink the number of TAC instructions. Others are
applied as part of final code generation—choosing which instructions to emit, how to
allocate registers and when/what to spill, and the like. And still other optimizations

may occur after final code generation, attempting to re-work the assembly code itself
into something more efficient.

Optimization can be very complex and time-consuming; it often involves multiple subphases, some of
which are applied more than once. Most compilers allow optimization to be turned off to speed up
compilation.

71
Railway Reservation System

Types of Optimization
Techniques used in optimization can be broken up among various scopes which can affect anything
from a single statement to the entire program. Generally speaking, locally scoped techniques are easier
to implement than global ones but result in smaller gains. Some examples of scopes include:

 Peephole optimizations:
Usually performed late in the compilation process after machine code has been generated. This
form of optimization examines a few adjacent instructions (like "looking through a peephole"
at the code) to see whether they can be replaced by a single instruction or a shorter sequence of
instructions. For instance, a multiplication of a value by 2 might be more efficiently executed
by left-shifting the value or by adding the value to itself.

 Local optimizations:
These only consider information local to a function definition. This reduces the amount of
analysis that needs to be performed (saving time and reducing storage requirements) but means
that worst case assumptions have to be made when function calls occur or global variables are
accessed. Optimizations performed exclusively within a basic block are called "local
optimizations". These are typically the easiest to perform since we do not consider any control
flow information, we just work with the statements within the block. Many of the local
optimizations we will discuss have corresponding global optimizations that operate on the same
principle, but require additional analysis to perform.

 Interprocedural or whole-program optimization:


These analyze all of a program's source code. The greater quantity of information extracted
means that optimizations can be more effective compared to when they only have access to
local information (i.e., within a single function). This kind of optimization can also allow new
techniques to be performed. For instance function in lining, where a call to a function is
replaced by a copy of the function body.

 Loop optimizations:

72
Railway Reservation System

These act on the statements which make up a loop, such as a for loop (eg, loop-invariant code
motion). Loop optimizations can have a significant impact because many programs spend a
large percentage of their time inside loops.

 Global Optimization, Data flow analysis:


With some additional analysis, we can apply similar optimizations across basic blocks, making
them global optimizations. It’s worth pointing out that global in this case does not mean across
the entire program. We usually only optimize one function at a time. Interprocedural analysis is
an even larger task, one not even attempted by some compilers. The additional analysis the
optimizer must do to perform optimizations across basic blocks is called data-flow analysis.

CHAPTER-8

73
Railway Reservation System

74
Railway Reservation System

Software Testing is an empirical investigation conducted to provide stakeholders with information


about the quality of the product or service under test, with respect to the context in which it is intended
to operate. Software Testing also provides an objective, independent view of the software to allow the
business to appreciate and understand the risks at implementation of the software. Test techniques
include, but are not limited to, the process of executing a program or application with the intent of
finding software bugs. It can also be stated as the process of validating and verifying that a software
program/application/product meets the business and technical requirements that guided its design and
development, so that it works as expected and can be implemented with the same characteristics.
Software Testing, depending on the testing method employed, can be implemented at any time in the
development process, however the most test effort is employed after the requirements have been
defined and coding process has been completed.

11.1 Testing methods

Software testing methods are traditionally divided into black box testing and white box testing. These
two approaches are used to describe the point of view that a test engineer takes when designing test
cases.
 Black box testing:
Black box testing treats the software as a "black box," without any knowledge of internal
implementation. Black box testing methods include: equivalence partitioning, boundary value
analysis, all-pairs testing, fuzz testing, model-based testing, traceability matrix, exploratory
testing and specification-based testing.
 Specification-based testing:
Specification-based testing aims to test the functionality of software according to the
applicable requirements. Thus, the tester inputs data into, and only sees the output from,
the test object. This level of testing usually requires thorough test cases to be provided
to the tester, who then can simply verify that for a given input, the output value (or
behavior), either "is" or "is not" the same as the expected value specified in the test
case. Specification-based testing is necessary, but it is insufficient to guard against certain
risks.

75
Railway Reservation System

Advantages and disadvantages

The black box tester has no "bonds" with the code, and a tester's perception is very simple: a
code must have bugs. Using the principle, "Ask and you shall receive," black box testers find
bugs where programmers don't.
But, on the other hand, black box testing has been said to be "like a walk in a dark labyrinth
without a flashlight," because the tester doesn't know how the software being tested was actually
constructed. That's why there are situations when (1) a black box tester writes many test cases to
check something that can be tested by only one test case, and/or (2) some parts of the back
end are not tested at all. Therefore, black box testing has the advantage of "an unaffiliated
opinion," on the one hand, and the disadvantage of "blind exploring," on the other:

White box testing:


White box testing, by contrast to black box testing, is when the tester has access to the internal
data structures and algorithms (and the code that implement these)Types of white box testing :-The
following types of white box testing exist:
• api testing - Testing of the application using Public and Private APIs.

• code coverage - creating tests to satisfy some criteria of code coverage. For example, the
test designer can create tests to cause all statements in the program to be executed at least
once.

• fault injection methods.


.
•static testing - White box testing includes all static testing.
White box testing methods can also be used to evaluate the completeness of a test suite
that was created with black box testing methods. This allows the software team to
examine parts of a system that are rarely tested and ensures that the most important
function points have been tested.
Two common forms of code coverage are:
•function coverage, which reports on functions executed

76
Railway Reservation System

• statement coverage, which reports on the number of lines executed to complete the test.
They both return a coverage metric, measured as a percentage.

77
Railway Reservation System

9. CONCLUSION

The project “Railway Reservation System” has been developed as per the requirement specification. It
has been developed in JAVA and SQL Server 2005. The complete system is thoroughly tested with the
availability data and throughout reports which are prepared manually.

It has been observed that to book a ticket online is easier than the manually. These are found to be more
accurate because of availability of information from various levels. design procedure is presented in this
project report.

This website is designed to fulfill all the requirements of passengers who like to travel by Train. Our
Website gives all the details about different trains which passes through different routes, running on
different days, about special or general train, provide information about available seats, train running
between two different stations, and PNR status of ticket. It makes the work easier to both the
administrator and user. User gets information according to requirement and administrator insert details
about train, update information of train, if any new train start running and delete information of train
which is not available. The admin part is invisible to the user, as per security concerned.

9.1 FUTURE SCOPE


78
Railway Reservation System

To develop Railway Reservation Website, including information about Train No, Train Type, Train
Name, different routes of train, E-Ticket, Online registration of user so that an user able to get ticket
online, PNR status, Seat availability these information is useful to complete the project successfully.
Here, with the help of our website passenger can get information in a more efficient manner without
going to the reservation counter and stand in a queue for the Ticket. Online Railway Reservation System
helps passenger not only to get information about trains but also help to update with the current scenario
of Railways.

In future we want to add some more information about the train. Here we emphasis more on reservation
part so, we want to add both information part and reservation part.
We make our website more users friendly. So, that in future a user can get information about train and to
book the ticket. We also want to add about the details of train which become late during journey and
also provide information of a running train its current stoppage time, Arrival and departure in case if
train start running late due to some uncertain circumstances.

9.2 REFERENCE

79
Railway Reservation System

Books
1-Kathy Sierra & Bert Bates, Head first JSP and Servlets
2-Chip Dawes & Biju Thomas, Introduction to Oracle9i
3-Roger Pressmen, Software Engineering

WEBSITES

 www.sourceforge.net
 www.javaranch.com
 www.wikipedia.com
 www.webreference.com

80

Вам также может понравиться