railway reservation.doc

Download RAILWAY RESERVATION.doc

Post on 17-Jul-2016

6 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

RAILWAY RESERVATION SYSTEM

Contents:

Acknowledgement

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

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

REQUIREMENTS SPECIFICATIONS

SOFTWARE REQUIREMENTS:

Operating System Windows XP

Java 5.0

HARDWARE REQUIREMENTS:

Computer processor- Pentium dualcore 1.2 ghz Hard Disk-320GB

RAM-3GB

DESIGN

MODULES: DATABASE DESIGN:The tables used are1. TRAINRESRVATION TABLE2. PASSENGER TABLE1. 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.

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 manipulationThe 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';

Transaction controlsTransactions, 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 definitionThe 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 waysfor example, adding a column to an existing table.

Data controlThe 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.

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]

HYPERLINK "http://en.wikipedia.org/wiki/Applet" \l "cite_note-answers.com-1#cite_note-answers.com-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 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 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.

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