Sunteți pe pagina 1din 29

RAILWAY RESERVATION

A MINOR PROJECT REPORT


SUBMITTED FOR THE PARTIAL FULFILLMENT OF AWARD OF THE DEGREE OF
Bachelor of Technology in Computer Science and Engineering

By
MANPREET KAUR(16BTCSE41)
ASHUTOSH NAYAK(16BTCSE04)

Under the Guidance


of
Mr.DEBASHREET DAS

Department of Computer Science Engineering and Application


SAMBALPUR UNIVERSITY INSTITUTE OF INFORMATION
TECHNOLOGY
Jyoti Vihar, Burla, Odisha- 768019
January, 2020
CERTIFICATE
This is to certify that the minor project entitled” Railway Reservation” has been
submitted by Manpreet kaur bearing Roll number 16BTCSE41 and Ashutosh Nayak
bearing Roll number 16BTCSE04 in partial fulfillment of the requirements for the
award of the Degree of Bachelor of Technology in Computer Science and
Engineering. This record of bonafide work carried out by them under my guidance and
supervision. The result embodied in this project report has not been submitted to any
other university or institute for the award of any degree.

Mr.Debashreet Das Dr.Sibarama Panigrahi Dr.Sudarson Jena


Asst. Professor&Guide Faculty in-charge, B.Tech Associate Professor&HOD
Dept. of CSE&A Dept. of CSE&Adept. Of CSE&A

ii

DECLARATION
We do hereby declare that the work embodied in this minor project
report entitled “Railway Reservation” is the outcome of genuine work
carried out by me under the direct supervision of Mr. Debashreet Das,
Assistant Professor, Department of Computer Science Engineering
and Application is submitted by me to Sambalpur University Institute
of Information Technology, Burlafor the award of the degree of
Bachelor of Technology. The work is original and has not been
previously formed the basis for the award of any other degree or
diploma.

Manpreet Kaur(16BTCSE41)
&
Ashutosh Nayak(16BTCSE04)

iii

ACKNOWLEDGEMENTS
I feel honored to avail myself of this opportunity to express my deep
sense of gratitude to my guide Mr. Debashreet Das, Department of
Computer Science Engineering, Sambalpur University Institute of
Information Technology, Burla, Odisha, India for his valuable
inspiration, guidance, and warm encouragement throughout my research
work. His profound knowledge and timely advice were very much
helpful in my research work without which my thesis could never be
able to see this day. Proud to be work under him and he has given me
every freedom for working in this Project.

Manpreet Kaur
&
Ashutosh Nayak

iv
ABSTRACT

The railway reservation system is software for the purpose of preserving


train seats at anytime and from anywhere. The application provides us
complete information about a train between specified source and
destination. This application gives current status of reservation of
particular train, fares for different classes of train and also waiting status.
For this application, a visitor must register to avail the service. In this
system, train records all maintained and retrieved. Administrator
monitors all users and there transactions. Administrator has complete
access to database and can add train or cancel train or add station for
particular train or skip a station for train. There are several payment
options for user like credit card, debit card and a user can also cancel
ticket. This application also provide current position of train i.e. name of
station between which the train is currently running. It provides familiar
and attractive interface with inserting and reporting capabilities.

v
LIST OF FIGURES

1. Figure 1 10
2. Figure 2 11
3. Figure 3 12
4. Figure 4 13
5. Figure 5 14
6. Figure 6 15

Vi
TABLE OF CONTENT
CERTIFICATE II
DECLARATION III
ACKNOWLEDGEMENT VI
ABSTRACT V

INTRODUCTION
1.CHAPTER-1 MODULE 1-8
1.1Database Design
1.2Front End
1.3Database Connectivity with JAVA
2.CHAPTER-2 UML DIAGRAMS 9-13
1.1Use Case Diagrams
1.2Class Diagrams
1.3Sequence Diagrams
1.4Deployment Diagrams
3.CHAPTER-3 DATA FLOW GRAPH 14-15
1.1Defination
1.2 0-Level DFD of Railway Reservation
1.3E-R Diagram
4.CHAPTER-4 TESTING 16
5.CHAPTER-5 17-
1.1Experiment and Result
1.1.1Screenshot
1.2Conclusion
REFERENCES
INTRODUCTION

Database is an organized collection of data. The data is typically


organized to model aspects of reality in a way that supports processes
requiring information. A Database Management System makes it
possible end users to create ,read, update and delete data in a database.
The Database management system manages three important things: the
data, the database engine that allows data to be accessed, locked and
modified and the database schema, which defines the database logical
structure. These three elements help provide concurrency, security, data
integrity and uniform administration procedure. The database
management system offers both logical and physical data independence.
The main purpose of maintaining database for Railway Reservation
System is to reduce the manual errors involved in the booking and
cancelling the tickets and make it convenient for the customers and
provide to maintain the data about their customers and also about the
seats available at them. Due to automation many loopholes that exists in
the manual maintenance of the records can be removed. The speed of
obtaining and processing the data will be fast. For future expansion the
proposed system can be web enabled so that the clients can make
various enquiries about train between two stations. Due to this,
sometimes a lot of problems occur and they are facing many disputes
which includes customers details, availability of seats in trains, number
of trains and their details.
CHAPTER 1

MODULES

DATABASE DESIGN:
The tables used are
1. TRAINRESRVATION TABLE
2. PASSENGER TABLE
1. TRAIN RESERVATION TABLE: This table contains the details of
trains. Such as train name , Source Station ,Destination Station, Arrival
Time, Destination Time, Number of Seats.

2.PASSENGER TABLE: This table contains the details of passenger1


such as Traveler name, train name, date, source, destination.

1
SQL (Structured Query Language)

SQL (Structured Query Language) is a database computer language


designed for managing data in relational database management systems
(RDBMS), and originally based upon Relational Algebra. Its scope
includes data query and update, schema creation and modification,
and data access control. The most common operation in SQL is the
query, which is performed with the declarative SELECT statement.
SELECT retrieves data from one or more tables, expressions.
A query includes a list of columns to be included in the final result
immediately following the SELECT keyword. An asterisk ("*") can also
be used to specify that the query should return all columns of the queried
tables. SELECT is the most complex statement in SQL, with optional
keywords and clauses that include:
• The FROM clause which indicates the table(s) from which data is to be
retrieved.
The FROM clause can include optional JOIN sub clauses to specify the
rules for joining tables.
• The WHERE clause includes a comparison predicate, which restricts
the rows returned by the query. The WHERE clause eliminates all rows
from the result set for which the comparison predicate does not evaluate
to True.The following is an example of a SELECT query that returns a
list of trains available. The query retrieves all rows from the train
reservation in which the source column contains a value as lingampally.
The asterisk (*) in the select list indicates that all columns of the train
reservation table should be included in the result set. SELECT * FROM
train reservation WHERE source=”lingampally”; Data manipulation
The Data Manipulation Language (DML) is the subset of SQL used to

2
add, update and delete data:
• INSERT adds rows (formally tuples) to an existing table, e.g.,:
insert into train reservation("LF1","Hyd","lingampally",20,10.30,11.30);
insert into passenger("xyz","LF1",x,21-03-10);
• UPDATE modifies a set of existing table rows, e.g.,:
UPDATE passenger SET noofseats=2 WHERE psgname = 'sss';
• DELETE removes existing rows from a table, e.g.,:
DELETE FROM trainreservation WHERE psgname = 'sss'; Transaction
controls Transactions, if available, DML operations:COMMIT causes all
data changes in a transaction to be made permanent.
• ROLLBACK causes all data changes since the last COMMIT or
ROLLBACK to be discarded, leaving the state of the data as it was prior
to those changes.Once the COMMIT statement completes, the
transaction's changes cannot be rolled back .Commit; Data definition
The Data Definition Language (DDL) manages table and index
structure. The most basic items of DDL are the CREATE, ALTER,
RENAME, DROP and TRUNCATE statements:
• CREATE creates an object (a table, for example) in the database.
Eg: create table trairnreservation(tname varchar(20),source
varchar(20),Destination varchar(20),Noofseats number(3),arrival
number(12,2),departure number(12,2));
Eg:create table passenger(psgname varchar(20),tname
varchar(20),Noofseats number(3),date varchar(20));
• DROP deletes an object in the database, usually irretrievably.
• ALTER modifies the structure of an existing object in various ways—
for example, adding a column to an existing table. Data control
The Data Control Language (DCL) authorizes users and groups of users
to access and manipulate data. Its two main statements are:
• GRANT authorizes one or more users to perform an operation or a set
of operations on an object.

3
• REVOKE eliminates a grant, which may be the default grant.
APPLET
An applet is any small application that performs one specific task;
sometimes running within the context of a larger program, perhaps as a
plugin. However, the term typically also refers to programs written in
the Java programming language which are included in an HTML page
All applets have the following four methods:
public void init();
public void start();
public void stop();
public void destroy();
They have these methods because their superclass, java.applet.Applet,
has these methods. (It has others too, but right now I just want to talk
about these four.)
In the superclass, these are simply do-nothing methods. For example,
public void init() {} Subclasses may override these methods to
accomplish certain tasks at certain times. For instance, the init() method
is a good place to read parameters that were passed to the applet via
<PARAM> tags because it's called exactly once when the applet starts
up. However, they do not have to override them. Since they're declared
in the superclass, the Web browser can invoke them when it needs to
without knowing in advance whether the method is implemented in the
superclass or the subclass. This is a good example of polymorphism. The
init() method is called exactly once in an applet's life, when the applet is
first loaded. It's normally used to read PARAM tags, start downloading
any other images or media files you need, and set up the user interface.
Most applets have init() methods. The start() method is called at least
once in an applet's life, when the applet is started or restarted. In some
cases it may be called more than once. Many applets you write will not

4
have explicit start()methods and will merely inherit one from their
superclass. A start() method is often used to start any threads the applet
will need while it runs.The stop() method is called at least once in an
applet's life, when the browser leaves the page in which the applet is
embedded. The applet's start() method will be called if at some later
point the browser returns to the page containing the applet. In some
cases the stop() method may be called multiple times in an applet's life.
Many applets you write will not have explicit stop()methods and will
merely inherit one from their superclass. Your applet should use the
stop() method to pause any running threads. When your applet is
stopped, it should not use any CPU cycles. The destroy() method is
called exactly once in an applet's life, just before the browser
unloads the applet. This method is generally used to perform any final
clean-up. For example, an applet that stores state on the server might
send some data back to the server before it's terminated. many applets
will not have explicit destroy() methods and just inherit one from their
superclass.

GRAPHIC OBJECT
In Java all drawing takes place via a Graphics object. This is an
instance of the class java.awt.Graphics. Initially the Graphics object you
use will be the one passed as an argument to an applet's paint() method.
Later you'll see other Graphics objects too. Everything you learn today
about drawing in an applet transfers directly to drawing in other objects
like Panels, Frames, Buttons, Canvases and more. Each Graphics object
has its own coordinate system, and all the methods of Graphics
including those for drawing Strings, lines, rectangles, circles, polygons
and more. Drawing in Java starts with particular Graphics object. You

5
get access to the Graphics object through the paint(Graphics g) method
of your applet. Each draw method call will look likeg.drawString("Hello
World", 0, 50) where g is the particular Graphics object with which
you're drawing. Load image:Image img = this.getImage(new
URL("http://www.prenhall.com/logo.gif")); The getImage() method is
provided by java.applet.Applet. The URL class is provided by
java.net.URL. Be sure to import it. Color is a class in the AWT.
Individual colors like red or mauve are instances of this class,
java.awt.Color. Be sure to import it if you want to use other than the
default colors. You create new colors using the same RGB triples that
you use to set background colors on web pages. However you use
decimal numbers instead of the hex values used by HTML's bgcolor
attribute. For example medium gray is Color(127, 127, 127). Pure white
is Color(255, 255,255). Pure red is (255, 0, 0) and so on. As with any
variable you should give your colors descriptive names. For instance
Color medGray = new Color(127, 127, 127);
Color cream = new Color(255, 231, 187);
Color lightGreen = new Color(0, 55, 0);
A few of the most common colors are available by name. These are
• Color.black
• Color.blue
• Color.cyan
• Color.darkGray
• Color.gray
• Color.green
• Color.lightGray
• Color.magenta
• Color.orange

6
• Color.pink
• Color.red
• Color.white
• Color.yellow
Color oldColor = g.getColor();
g.setColor(Color.pink);
g.drawString("This String is pink!", 50, 25);
g.setColor(Color.green);
g.drawString("This String is green!", 50, 50);
g.setColor(oldColor);
Choosing a font face is easy. First you create a new Font object. Then
you call g.setFont(Font f). To instantiate a Font object use this
constructor: public Font(String name, int style, int size) name is the
name of the font family, e.g. "Serif", "SansSerif", or "Mono".
size is the size of the font in points. In computer graphics a point is
considered to be equal to one pixel. 12 points is a normal size font. 14
points is probably better on most computer displays. Smaller point sizes
look good on paper printed with a high resolution printer, but
not in the lower resolutions of a computer monitor. Style is an
mnemonic constant from java.awt.Font that tells whether the text will be
bold, italic or plain. The three constants are Font.PLAIN, Font.BOLD,
and Font.ITALIC. The program below prints each font in its own face
and 14 point bold. A basic example using the java.applet package

7
DATABASE CONNECTIVITY
Java Database Connectivity (JDBC) provides Java developers with a
standard API that is used to access databases, regardless of the driver
and database product. To use JDBC, you'll need at least JDK 1.1, a
database, and a JDBC driver. Installing the first two should be
straightforward, but finding a JDBC driver requires a little more effort.
JDBC presents a uniform interface to databases - change vendors and
your applications only need to change their driver.
There are plenty of drivers now for JDBC that support popular
databases. If you can use a JDBC driver that works specifically for your
database, then that's great! If not, don't worry - Sun provides a driver
that is compatible with ODBC, so you should be able to connect to any
ODBC compliant database. The JDBC to ODBC bridge comes installed
as part of JDK1.1, so if this is your target platform, the driver will
already be installed. You'll need to create an ODBC datasource for your
database, before your Java applications can access it.

8
CHAPTER 2
UML DIAGRAMS

UML stands for Unified Modeling Language. This object-oriented


system of notation has evolved from the work of Grady Booch, James
Rumbaugh, Ivar Jacobson, and the Rational Software Corporation.
These renowned computer scientists fused their respective technologies
into a single, standardized model. Today, UML is accepted by the
Object Management Group (OMG) as the standard for modeling object
oriented programs. Mainly, UML has been used as a general-purpose
modeling language in the field of software engineering. However, it has
now found its way into the documentation of several business
processes or workflows. For example, activity diagrams, a type of UML
diagram, can be used as a replacement for flowcharts. They provide both
a more standardized way of modeling workflows as well as a wider
range of features to improve readability and efficacy.UML diagrams, in
this case, are used to communicate different aspects and characteristics
of a system. However, this is only a top-level view of the system and
will most probably not include all the necessary details to execute the
project until the very end.

 Forward Design – The design of the sketch is done before coding the
application. This is done to get a better view of the system or workflow
that you are trying to create. Many design issues or flaws can be
revealed, thus improving the overall project health and well-being.
 Backward Design – After writing the code, the UML diagrams are
drawn as a form of documentation for the different activities, roles,
actors, and workflows.

9
CLASS DIAGRAM: Class diagram is a collection set of objects

Fig1:class diagram for railway reservation

10
USECASE DIAGRAM: Use case diagrams model the functionality of
system using actors and use cases.

Fig2:Usecase diagram for railway reservation

11
SEQUENCE DIAGRAM:Sequence diagrams describe interactions
among classes in terms of an exchange of messages over time.

Fig3:Sequence diagram for railway reservation

DEPLOYMENT DIAGRAM: Deployment diagrams depict the


physical resources in a system, including nodes, components, and
connections. Component diagrams describe the organization of physical
software components, including source code, runtime (binary) code, and
executables.
12
Fig4:Deployment diagram for railway reservation

13
CHAPTER 3
DATA FLOW DIAGRAM
Defination:-
Data-Flow design is concerned with designing a sequence of functional
transformations that converts system inputs into the required outputs.
Data-flow diagrams are useful and intuitive way of describing a system.
They are normally understandable without special training, especially if
control information is excluded. The DFD also provides information
about the outputs and inputs of each entity and the process itself. A data-
flow diagram has no control flow, there are no decision rules and no
loops. Specific operations based on the data can be represented by
a flowchart.

Fig5: Context Level DFD of Railway Reservation

14
ER DIAGRAM
ER model stands for an Entity-Relationship model. It is a high-level data
model. This model is used to define the data elements and relationship
for a specified system .It develops a conceptual design for the database.
It also develops a very simple and easy to design view of data.
In ER modeling, the database structure is portrayed as a diagram called
an entity-relationship diagram.

Fig6:E-R diagram for railway reservation


15
CHAPTER 4
TESTING
The testing phase is an important part of software development. It is the
process of finding errors and missing operations and also a complete
verification to determine whether the objectives are met and the user
requirements are satisfied. Software testing is carried out in three steps:
The first includes unit testing, where in each module is tested to provide
its correctness, validity and also determine any missing operations and to
verify whether the objectives have been met. Errors are noted down and
corrected immediately. Unit testing is the important and major part of
the project. So errors are rectified easily in particular module and
program clarity is increased. In this project entire system is divided into
several modules and is developed individually. So unit testing is
conducted to individual modules. The second step includes Integration
testing. It need not be the case, the software whose modules when run
individually and showing perfect results, will also show perfect results
when run as a whole. The individual modules are clipped under this
major module and tested again and verified the results. This is due to
poor interfacing, which may results in data being lost across an interface.
A module can have inadvertent, adverse effect on any other or on the
global data structures, causing serious problems. The final step involves
validation and testing which determines which the software functions as
the user expected. Here also some modifications were. In the completion
of the project it is satisfied fully by the end user.

16
CHAPTER 5
Screenshots
User Interface Page

User Login

17
Ticket Booking

18
Ticket Generated

19
CONCLUSION

In the last we conclude that our project is only the gist of the online
reservation system. User friendliness is a must that is the user must get
the details without complicated searching procedures. Other important
requirements of software are data security, extensibility and
maintainability. All these features are included in the web application.
So the program created is just an instance of the original Online Railway
Reservation System.

20
REFERENCES

 https://www.irctc.co.in/
 https://en.wikipedia.org/wiki/Indian_Railways
 https://en.wikipedia.org/wiki/Indian_Railway_Catering_and_To
urism_Corporation
 http://library.atmiya.net:8080/dspace/bitstream/handle/12345678
9/2355/RAILWAY%20%20RESERVATION.pdf?sequence=1&
isAllowed=y
 https://www.slideshare.net/Abhishekyadav305/railway-
reservation-system-69347115
 https://www.travelogyindia.com/blog/introduction-to-indian-
railway-reservation
 http://indianrail-infocentral.blogspot.com/2009/02/date-of-
journey-reservation-form-3.html

21

S-ar putea să vă placă și