+ All Categories
Home > Documents > Railway Reservation System

Railway Reservation System

Date post: 05-May-2017
Category:
Upload: vijendra-solanki
View: 373 times
Download: 26 times
Share this document with a friend
66
Contents: Abstract Introduction Requirements Specifications Design Modules Database Design Front End Database Connectivity With Java IDE UML Diagrams Use Case Diagrams Class Diagrams Sequence Diagrams Component Diagrams Deployment Diagrams Implementation Coding Testing Results Screen Shots Conclusion Future Scope References
Transcript
Page 1: Railway Reservation System

Contents:

Abstract

Introduction

Requirements Specifications

Design

Modules

Database Design

Front End

Database Connectivity With Java

IDE

UML Diagrams

Use Case Diagrams

Class Diagrams

Sequence Diagrams

Component Diagrams

Deployment Diagrams

Implementation

Coding

Testing

Results

Screen Shots

Conclusion

Future Scope

References

Page 2: Railway Reservation System

ABSTRACT

Designing a database for local train reservation system and trying to get an access to the

database and reserve.

This project deals with reserving tickets for the local trains which is heck these days .So

inorder to make it convenient to travel we can book tickets priorily. This makes the travel

smooth and convenient. This also helps in checking the details afterwards.

Page 3: Railway Reservation System

INTRODUCTION

Designing a database for local train reservation system and trying to get an access to the

database and reserve.

This project deals with reserving tickets for the local trains which is heck these days .So

inorder to make it convenient to travel we can book tickets priorily. This makes the travel

smooth and convenient. This also helps in checking the details afterwards.

Page 4: Railway Reservation System

REQUIREMENTS SPECIFICATIONS

SOFTWARE REQUIREMENTS:

Operating System – Windows XP

Eclipse 3.2

Java 5.0

HTML

HARDWARE REQUIREMENTS:

Computer processor- Pentium V duo core

Clock speed-700MHz Processor

Hard Disk-320GB

RAM-3GB

Page 5: Railway Reservation System

DESIGN

MODULES:

DATABASE DESIGN:

The tables used are

1. TRAINRESRVATION TABLE

2. PASSENGER TABLE

1. TRAINRESERVATION TABLE: This table contains the details of trains Such as

train name , Source Station ,Destination Station, Arrival Time, Destination Time , No.of

seats .

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

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

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, or 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 subclauses to specify the rules for

joining tables.

Page 6: Railway Reservation System

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 trainreservation in which the sourcr column contains a

value as lingampally. The asterisk (*) in the select list indicates that all columns of the

trainreservation table should be included in the result set.

SELECT * FROM trainreservation WHERE source=”lingampally”;

Data manipulation

The Data Manipulation Language (DML) is the subset of SQL used to add, update and

delete data:

INSERT adds rows (formally tuples) to an existing table, e.g.,: insert into trainreservation("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';

Page 7: Railway Reservation System

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.

REVOKE eliminates a grant, which may be the default grant.

Page 8: Railway Reservation System

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.[1][2] 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.

Page 9: Railway Reservation System

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

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.

For example, in a video applet, the init() method might draw the controls and start loading

the video file. The start() method would wait until the file was loaded, and then start playing

it. The stop() method would pause the video, but not rewind it. If the start() method were

called again, the video would pick up where it left off; it would not start over from the

beginning. However, if destroy() were called and then init(), the video would start over from

the beginning.

In the JDK's appletviewer, selecting the Restart menu item calls stop() and then start().

Selecting the Reload menu item calls stop(), destroy(), and init(), in that order. (Normally the

byte codes will also be reloaded and the HTML file reread though Netscape has a problem

with this.)

The applet start() and stop() methods are not related to the similarly named methods in the

java.lang.Thread class.

Page 10: Railway Reservation System

Your own code may occasionally invoke start() and stop(). For example, it's customary to

stop playing an animation when the user clicks the mouse in the applet and restart it when

they click the mouse again.

Your own code can also invoke init() and destroy(), but this is normally a bad idea. Only the

environment should call init() and destroy().

Java uses the standard, two-dimensional, computer graphics coordinate system. The first

visible pixel in the upper left-hand corner of the applet canvas is (0, 0). Coordinates increase

to the right and down.

GRAPHIC OBJECTS: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 get access to the Graphics object through the

paint(Graphics g) method of your applet. Each draw method call will look like

g.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

Page 11: Railway Reservation System

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

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);

Page 12: Railway Reservation System

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

The following example is made simple enough to illustrate the essential use of Java applets

through its java.applet package. It also uses classes from the Java Abstract Window Toolkit

(AWT) for producing actual output (in this case, the "Hello, world!" message).

import java.applet.Applet;

import java.awt.*;

// Applet code for the "Hello, world!" example.

// This should be saved in a file named as "HelloWorld.java".

public class HelloWorld extends Applet {

// This method is mandatory, but can be empty (i.e., have no actual code).

public void init() { }

// This method is mandatory, but can be empty.

public void stop() { }

Page 13: Railway Reservation System

// Print a message on the screen (x=20, y=10).

public void paint(Graphics g) {

g.drawString("Hello, world!", 20,10);

}

}

For compilation, this code is saved on a plain-ASCII file with the same name as the class and

.java extension, i.e. HelloWorld.java. The resulting HelloWorld.class applet should be

installed on the web server and is invoked within an HTML page by using an <APPLET> or

a <SCRIPT> tag. For example:

<!DOCTYPE HTML PUBLIC

"-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<HTML>

<HEAD>

<TITLE>HelloWorld_example.html</TITLE>

</HEAD>

<BODY>

<H1>A Java applet example</H1>

<P>Here it is: <APPLET code="HelloWorld.class" WIDTH="200" HEIGHT="40">

This is where HelloWorld.class runs.</APPLET></P>

</BODY>

</HTML>

Displaying the HelloWorld_example.html page from a Web server, the result should look as

this:

A Java applet example

Here it is: Hello, world!

To minimize download time, applets are usually delivered in a form of compressed zip

archive (having jar extension). If all needed classes (only one in our case) are placed in

compressed archive example.jar, the embedding code would look differently:

<P>Here it is: <APPLET code="HelloWorld" WIDTH="200" HEIGHT="40"

ARCHIVE="example.jar">

Page 14: Railway Reservation System

This is where HelloWorld.class runs.</APPLET></P>

Advantages

A Java applet can have any or all of the following advantages:

It is simple to make it work on Linux, Windows and Mac OS i.e. to make it cross

platform. Applets are supported by most web browsers

The same applet can work on "all" installed versions of Java at the same time, rather

than just the latest plug-in version only. However, if an applet requires a later version

of the JRE the client will be forced to wait during the large download.

Most web browsers cache applets, so will be quick to load when returning to a web

page. Applets also improve with use: after a first applet is run, the JVM is already

running and starts quickly (JVM will need to restart each time the browser starts

fresh).

It can move the work from the server to the client, making a web solution more

scalable with the number of users/clients

If standalone program (like Google Earth) talks to the web server, that server

normally needs to support also previous versions as the user may not keep it always

updated. Differently, the browser updates the applet so there is no need to support the

legacy versions. Only due configuration mistakes the applet may get stuck in the

cache and have issues when new versions come out.

The applet naturally supports the changing user state like figure positions on the

chessboard.

Developers can develop and debug an applet direct simply by creating a main routine

(either in the applet's class or in a separate class) and call init() and start() on the

applet, thus allowing for development in their favorite J2SE development

environment. All one has to do after that is re-test the applet in the appletviewer

program or a web browser to ensure it conforms to security restrictions.

Page 15: Railway Reservation System

An untrusted applet has no access to the local machine and can only access the server

it came from. This makes such applet much safer to run than standalone executable

that it could replace. However signed applet can have full access to the machine it is

running on if the user agrees.

Disadvantages

A Java applet may have any of the following disadvantages:

It requires the Java plug-in.

Some organizations only allow software installed by the administrators. As a result,

some users can only view applets that are important enough to contact the

administrator asking to install the Java plug-in.

As with any client side scripting, security restrictions may make difficult or even

impossible for untrusted applet to achieve the desired goals.

Some applets require a specific JRE. This is discouraged [22].

If applet requires newer or specific JRE than available on the system, the user running

it first time will need to wait for the large JRE download to complete.

Java automatic installation or update may fail if proxy is used to access the web. This

makes applet with specific requirements impossible to run unless Java is manually

updated. Java automatic updater that is part of Java installation also may be complex

to configure if it must work through proxy.

Unlike the older applet tag, the object tag needs workarounds to write a cross-browser

HTML.

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.

Page 16: Railway Reservation System

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.

Connecting to a database

In order to connect to a database, you need to perform some initialization first. Your

JDBC driver has to be loaded by the Java Virtual Machine classloader, and your

application needs to check to see that the driver was successfully loaded. We'll be using

the ODBC bridge driver, but if your database vendor supplies a JDBC driver, feel free to

use it instead.

// Attempt to load database driver

try

{

// Load Sun's jdbc-odbc driver

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();

}

catch (ClassNotFoundException cnfe) // driver not found

{

System.err.println ("Unable to load database driver");

System.err.println ("Details : " + cnfe);

System.exit(0);

}

We try to load the JdbcOdbcDriver class, and then catch the ClassNotFoundException if

it is thrown. This is important, because the application might be run on a non-Sun virtual

machine that doesn't include the ODBC bridge, such as Microsoft's JVM. If this occurs,

the driver won't be installed, and our application should exit gracefully.

Page 17: Railway Reservation System

Once our driver is loaded, we can connect to the database. We'll connect via the driver

manager class, which selects the appropriate driver for the database we specify. In this

case, we'll only be using an ODBC database, but in more complex applications, we might

wish to use different drivers to connect to multiple databases. We identify our database

through a URL. No, we're not doing anything on the web in this example - a URL just

helps to identify our database.

A JDBC URL starts with "jdbc:"  This indicates the protocol (JDBC). We also specify

our database in the URL. As an example, here's the URL for an ODBC datasource called

'demo'. Our final URL looks like this :

jdbc:odbc:demo

To connect to the database, we create a string representation of the database. We take the

name of the datasource from the command line, and attempt to connect as user "dba",

whose password is "sql".

// Create a URL that identifies database

String url = "jdbc:odbc:" + args[0];

// Now attempt to create a database connection

Connection db_connection =

DriverManager.getConnection (url, "dba", "sql");

As you can see, connecting to a database doesn't take much code.

Executing database queries

In JDBC, we use a statement object to execute queries. A statement object is responsible

for sending the SQL statement, and returning a set of results, if needed, from the query.

Statement objects support two main types of statements - an update statement that is

normally used for operations which don't generate a response, and a query statement that

returns data.

// Create a statement to send SQL

Statement db_statement = db_connection.createStatement();

Page 18: Railway Reservation System

Once you have an instance of a statement object, you can call its executeUpdate and

executeQuery methods. To illustrate the executeUpdate command, we'll create a table

that stores information about employees. We'll keep things simple and limit it to name

and employee ID.

// Create a simple table, which stores an employee ID and name

db_statement.executeUpdate

("create table employee { int id, char(50) name };");

// Insert an employee, so the table contains data

db_statement.executeUpdate

("insert into employee values (1, 'John Doe');");

// Commit changes

db_connection.commit();

Now that there's data in the table, we can execute queries. The response to a query will be

returned by the executeQuery method as a ResultSet object. ResultSet objects store the

last response to a query for a given statement object. Instances of ResultSet have methods

following the pattern of getXX where XX is the name of a data type. Such data types

include numbers (bytes, ints, shorts, longs, doubles, big-decimals), as well as strings,

booleans, timestamps and binary data.

// Execute query

ResultSet result = db_statement.executeQuery

("select * from employee");

// While more rows exist, print them

while (result.next() )

{

// Use the getInt method to obtain emp. id

System.out.println ("ID : " + result.getInt("ID"));

// Use the getString method to obtain emp. name

System.out.println ("Name : " + result.getString("Name"));

System.out.println ();

Page 19: Railway Reservation System

}

SAMPLE: A Java applet that use JDBC applet driver to access a database

This sample shows how to write a Java Applet that uses the

JDBC Type 3 and 4 driver to access a DB2 database.

By default, this sample uses JDBC Type 4 driver to connect to

the "sample" database (Recommended). Run this sample using the

following steps:

1. Create and populate the "sample" database with the following

command: db2sampl

2. Customize Applt.html with your server, port, user ID, and

password. Refer to Applt.html for details.

3. Compile the program with the following command:

javac Applt.java

Alternatively, you can compile the program with the following

command if you have a compatible make/nmake program on

your system:

make/nmake Applt

4. Ensure that your working directory is accessible by your web

browser. If it is not, copy Applt.class and Applt.html into

a directory that is accessible.

5. To use the JDBC Type 4 driver, copy sqllib\java\db2jcc.jar on

Windows or sqllib/java/db2jcc.jar on UNIX, into the same

directory as Applt.class and Applt.html.

6. To run this sample, start your web browser (which must support

Java 1.3) and load Applt.html on your client machine.

You can view it locally with the following command:

appletviewer Applt.html

Page 20: Railway Reservation System

ECLIPSE WORKING:

1. Eclipse Overview

Eclipse an open source community whose projects building tools and frameworks for creating general purpose application.

The most popular usage of Eclipse is as a Java development environment which will be described in this article.

2 1.Installation

Download "Eclipse IDE for Java Developers" from the website Eclipse Downloads and unpack it to a directory. This is sufficient for Eclipse to be used; no additional installation procedure is required.

Use a directory path which does not contain spaces in its name.

Eclipse requires an installed Java Runtime. I recommended to use Java 6 (also known as Java 1.6).

2.2. Start Eclipse

To start Eclipse double-click on the file eclipse.exe in your installation directory.

The system will prompt you for a workspace. The workspace is the place there you store your Java projects (more on workspaces later). Select a suitable (empty) directory and press Ok.

Eclipse will start and show the Welcome page.

Page 21: Railway Reservation System

Close the welcome page by press in little x besides the Welcome.

3. Eclipse UI Overview

Eclipse provides perspectives, views and editors. Views and editors are grouped into

perspectives. All projects are located in a workspace.

3.1. Workspace

The workspace is the physical location (file path) you are working in. You can choose the

workspace during startup of eclipse or via the menu (File-> Switch Workspace-> Others).

All your projects, sources files, images and other artifacts will be stored and saved in

your workspace.

Page 22: Railway Reservation System

To predefine the workspace you can use the startup parameter -data path_to_workspace,

e.g. c:\eclipse.exe -data "c:\temp" Please note that you have to put the path name into

brackets.

To see the current workspace directory in the title of Eclipse use -showLocation as

additional parameter.

3.2. Perspective

A perspective is a visual container for a set of views and editors.

You can change the layout within a perspective (close / open views, editors, change the

size, change the position, etc.)

A common problem is that you closed a view and don't know how to re-open this view.

You can reset a perpective it to it original state via the menu "Window" -> "Reset

Perspective".

Eclipse allow you to switch to another perspective via the menu Window->Open

Perspective -> Other.

For Java development you usually use the "Java Perspective".

3.3. Views and Editors

A view is typically used to navigate a hierarchy of information or to open an editor.

Changes in a view are directly applied.

Editors are used to modify elements. Editors can have code completion, undo / redo, etc.

To apply the changes in an editor to the underlying resources, e.g. Java source file, you

usually have to save.

Page 23: Railway Reservation System

4. Create your first Java program

The following will describe how to create a minimal Java program using Eclipse. It will

be the classical "Hello World" program. Our program will write "Hello Eclipse!" to the

console.

4.1. Create project

Select from the menu File -> New-> Java project. Maintain "de.vogella.eclipse.ide.first"

as the project name. Select "Create separate source and output folders".

Page 24: Railway Reservation System

Press finish to create the project. A new project is created and displayed as a folder. Open

the folder "de.vogella.eclipse.ide.first"

Page 25: Railway Reservation System

4.2. Create package

Create now a package. A good convention is to use the same name for the top package as

the project. Create therefore the package "de.vogella.eclipse.ide.first".

Select the folder src, right mouse click on it and select New -> Package.

4.3. Create Java class

Right click on your package and select New -> Class

Page 26: Railway Reservation System

Create MyFirstClass, select the flag "public static void main (String[] args)"

Maintain the following code.

package de.vogella.eclipse.ide.first;

public class MyFirstClass {

public static void main(String[] args) {System.out.println("Hello Eclipse!");

}

Page 27: Railway Reservation System

}

4.4. Run your project in Eclipse

Now run your code. Right click on your Java class and select Run-as-> Java application

Finished! You should see the output in the console.

4.5. Run your Java program outside Eclipse (create jar file)

To run your Java program outside of Eclipse you need to export it as a jar file. Select

your project, right click on it and select "Export".

Page 28: Railway Reservation System

Select JAR file, select next. Select your project and maintain the export destination and a

name for the jar file. I named it "myprogram.jar".

Page 29: Railway Reservation System

Press finish. This will create a jar file in your select output directory.

4.6. Run your program outside Eclipse

Open a command shell, e.g. under Microsoft Windows select Start -> Run and type in cmd. This should open a consle.

Switch to your output directory, e.g. by typing cd path, e.g. if you jar is located in "c:\temp" type "cd c:\temp".

To run this program you need to include the jar file into your classpath. See Classpath and Java JAR Files for details.

java -classpath myprogram.jar de.vogella.eclipse.ide.first.MyFirstClass

Page 30: Railway Reservation System

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.

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

FIG1:CLASS DIAGRAM FOR RAILWAY RESERVATION

Page 31: Railway Reservation System

USECASE DIAGRAM:

Use case diagrams model the functionality of system using

actors and use cases

Page 32: Railway Reservation System

SEQUENCE DIAGRAM:

Sequence diagrams describe interactions among classes in terms of an exchange of

messages over time.

Page 33: Railway Reservation System

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, run-time (binary) code, and executables.

Page 34: Railway Reservation System

COMPONENT DIAGRAM:

Component diagrams describe the organization of physical software

components, including source code, run-time (binary) code, and executables.

Page 35: Railway Reservation System

IMPLEMENTATION:

CODING:

<HTML><HEAD><TITLE>RESERVATION</TITLE><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"><script type="text/JavaScript"><!--function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0;}//--></script><style type="text/css"><!--.style1 {color: #FFFFFF}.style2 {color: #0000FF}a:hover {

color: #00FF00;text-decoration: none;

}a:link {

text-decoration: none;}a:visited {

text-decoration: none;}a:active {

text-decoration: none;}--></style></HEAD><BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<TABLE align="center"WIDTH=792 BORDER=0 CELLPADDING=0 CELLSPACING=0><TR>

<TD COLSPAN=8 ROWSPAN=2><IMG SRC="images/RESERVATION_01.gif" WIDTH=176

HEIGHT=121 ALT=""></TD><TD COLSPAN=3>

<IMG SRC="images/RESERVATION_02.gif" WIDTH=413 HEIGHT=1 ALT=""></TD>

<TD COLSPAN=2 ROWSPAN=2><IMG SRC="images/RESERVATION_03.gif" WIDTH=203

HEIGHT=121 ALT=""></TD></TR><TR>

Page 36: Railway Reservation System

<TD COLSPAN=2><IMG SRC="images/RESERVATION_04.jpg" WIDTH=411

HEIGHT=120 ALT=""></TD><TD>

<IMG SRC="images/RESERVATION_05.gif" WIDTH=2 HEIGHT=120 ALT=""></TD>

</TR><TR>

<TD ROWSPAN=6><IMG SRC="images/RESERVATION_06.gif" WIDTH=2

HEIGHT=235 ALT=""></TD><TD COLSPAN=7 bgcolor="#870505">&nbsp;</TD><TD ROWSPAN=3 align="center" bgcolor="#870505"><span

class="style1"><strong></span><strong><a href="Railway-Reservation.html"><font color="#FFFFFF">Home</font></a></strong><span class="style1"><strong> || <a href="sitemap.html"><font color="#FFFFFF">Site Map</font></a> || <span class="style1"><a href="rail-map.jpg"><font color="#FFFFFF">Railway Map</font></a> || <a href="image.html"><font color="#FFFFFF">Images</font></a> </strong></span><strong>&nbsp;</strong></TD>

<TD COLSPAN=3 ROWSPAN=3 bgcolor="#870505">&nbsp;</TD><TD ROWSPAN=3 bgcolor="#870505">&nbsp;</TD>

</TR><TR>

<TD COLSPAN=7 bgcolor="#870505"><IMG SRC="images/RESERVATION_11.gif" WIDTH=174

HEIGHT=1 ALT=""></TD></TR><TR>

<TD COLSPAN=2 ROWSPAN=2 bgcolor="#870505"><IMG SRC="images/RESERVATION_12.gif" WIDTH=3

HEIGHT=12 ALT=""></TD><TD COLSPAN=3 ROWSPAN=2 bgcolor="#870505">

<IMG SRC="images/RESERVATION_13.gif" WIDTH=129 HEIGHT=12 ALT=""></TD>

<TD COLSPAN=2 bgcolor="#870505"><IMG SRC="images/RESERVATION_14.gif" WIDTH=42

HEIGHT=2 ALT=""></TD></TR><TR>

<TD><IMG SRC="images/RESERVATION_15.gif" WIDTH=1

HEIGHT=10 ALT=""></TD><TD COLSPAN=6 ROWSPAN=5

background="images/RESERVATION_16.gif" WIDTH=657 HEIGHT=464 ALT=""><iframe height=460 src="availability1.html" frameborder=0 width=655 name=train scrolling=yes> </iframe></TD>

</TR><TR>

<TD ROWSPAN=2><IMG SRC="images/RESERVATION_17.gif" WIDTH=2

HEIGHT=198 ALT=""></TD><TD COLSPAN=5>

<IMG SRC="images/RESERVATION_18.gif" WIDTH=131 HEIGHT=28 ALT=""></TD>

Page 37: Railway Reservation System

</TR><TR>

<TD COLSPAN=2><IMG SRC="images/RESERVATION_19.gif" WIDTH=10

HEIGHT=170 ALT=""></TD><TD><table width="107" border="0">

<tr> <td align="center"><span class="style4 style2"><a href="trainschedule.html">Train Schedule</a> </span></td> </tr> <tr> <td align="center"><span class="style4 style2"><a href="tatkal.html">Tatkal Scheme</a> </span></td> </tr> <tr> <td align="center"><span class="style4 style2"><a href="officeinindia.html">Office in India</a> </span></td> </tr> <tr> <td align="center"><span class="style4 style2"><a href="availability.html">Availability</a></span></td> </tr> <tr> <td align="center"><span class="style2"></span></td> </tr> </table></TD>

<TD COLSPAN=2 ROWSPAN=3><IMG SRC="images/RESERVATION_21.gif" WIDTH=9

HEIGHT=426 ALT=""></TD></TR><TR>

<TD COLSPAN=5><IMG SRC="images/RESERVATION_22.gif" WIDTH=126

HEIGHT=30 ALT=""></TD></TR><TR>

<TD COLSPAN=4><IMG SRC="images/RESERVATION_23.gif" WIDTH=14

HEIGHT=226 ALT=""></TD><TD background="images/RESERVATION_24.gif" WIDTH=112

HEIGHT=226 ALT=""><table width="110" border="0"> <tr> <td align="center"><strong>Train -Info </strong></td> </tr> <tr> <td align="center"><form name="form2"> <select name="menu2" onChange="MM_jumpMenu('parent',this,0)"> <option selected>Select</option> <option value="rajdhani.html">Rajdhani</option> <option value="shatabdi.html">Shatabdi</option> <option value="tourist.html">Tourist</option> <option value="garibrath.html">Garibrath</option> </select> </form> </td> </tr> <tr>

Page 38: Railway Reservation System

<td align="center"><strong>View Code </strong></td> </tr> <tr> <td align="center"><form name="form3"> <select name="menu3" onChange="MM_jumpMenu('parent',this,0)"> <option>select</option> <option value="quota.html">Quota</option> <option value="class1.html">Class</option> <option value="station.html">Station</option> </select> </form> </td> </tr> <tr> <td align="center"><strong>Rules</strong></td> </tr> <tr> <td align="center"><form name="form1"> <select name="menu1" onChange="MM_jumpMenu('parent',this,0)"> <option selected>Select</option> <option value="RESERVATION.html">Reservation</option> <option value="refund.html">Refund</option> <option value="lagguage.html">Lagguage</option> </select> </form> </td> </tr> </table></TD>

</TR><TR>

<TD><IMG SRC="images/spacer.gif" WIDTH=2 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=2 HEIGHT=1 ALT=""></TD>

<TD><IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=9 HEIGHT=1 ALT=""></TD>

<TD><IMG SRC="images/spacer.gif" WIDTH=112 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=8 HEIGHT=1 ALT=""></TD>

<TD><IMG SRC="images/spacer.gif" WIDTH=1 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=41 HEIGHT=1 ALT=""></TD>

<TD><IMG SRC="images/spacer.gif" WIDTH=315 HEIGHT=1

ALT=""></TD>

Page 39: Railway Reservation System

<TD><IMG SRC="images/spacer.gif" WIDTH=96 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=2 HEIGHT=1 ALT=""></TD>

<TD><IMG SRC="images/spacer.gif" WIDTH=55 HEIGHT=1

ALT=""></TD><TD>

<IMG SRC="images/spacer.gif" WIDTH=148 HEIGHT=1 ALT=""></TD>

</TR></TABLE><!-- End ImageReady Slices --></BODY></HTML>

TESTING

Page 40: Railway Reservation System

 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.

RESULTS:

Page 41: Railway Reservation System

ScreenShots:

1. Home page :

2.Train Details:

Page 42: Railway Reservation System

3.Check the availability of seats:

Page 43: Railway Reservation System

4.After booking the ticket:

Page 44: Railway Reservation System

5.PRINTING TICKET:

Page 45: Railway Reservation System

6.Seats not available:

Page 46: Railway Reservation System

7.Testcase_1 ScreenShot:

Page 47: Railway Reservation System

8:Testcase_2 ScreenShot:

Page 48: Railway Reservation System

9.Screen shot for seats are not available:

Page 49: Railway Reservation System

CONCLUSION

Page 50: Railway Reservation System

In the last we conclude that MMTs Railways is having a strong IT Infrastructure

and a well equipped railway reservation system but there is some shortcoming in the

system on which we have tried to work on it and successfully completed our project.

FUTURE SCOPE

Page 51: Railway Reservation System

If anyone wants this project then he or she can make an additional database of

TRAINFARE. And database for update availability of seats which is available after the

cancellation of ticket on that specific train . etc.

He or she can also add some command buttons in the existing software and

extend working of the software.


Recommended