Sie sind auf Seite 1von 51

Contents:

Abstract
Introduction
Requirements Specifications
Design
Modules
Database Design
Front End
Database Connectivity Wit !ava
IDE
UML Diagrams
"se Case Diagrams
Class Diagrams
Sequence Diagrams
Component Diagrams
Deployment Diagrams
Implementation
Coding
Testing
Results
Screen Sots
Conclusion
Future Scope
References
ABSTRACT
Designing a database for local train reservation system and trying to get an access to te
database and reserve#
$is pro%ect deals &it reserving tic'ets for te local trains &ic is ec' tese days #So
inorder to ma'e it convenient to travel &e can boo' tic'ets priorily# $is ma'es te travel
smoot and convenient# $is also elps in cec'ing te details after&ards#
INTRODUCTION
Designing a database for local train reservation system and trying to get an access to te
database and reserve#
$is pro%ect deals &it reserving tic'ets for te local trains &ic is ec' tese days #So
inorder to ma'e it convenient to travel &e can boo' tic'ets priorily# $is ma'es te travel
smoot and convenient# $is also elps in cec'ing te details after&ards#
R!UIRMNTS S"CIFICATIONS
SOFT#AR R!UIRMNTS:
(perating System ) Windo&s *+
Eclipse ,#-
!ava .#/
0$M1
$ARD#AR R!UIRMNTS:
Computer processor2 +entium 3 duo core
Cloc' speed24//M05 +rocessor
0ard Dis'2,-/67
RAM2,67
DSI%N
MODULS:
DATABAS DSI%N:
$e tables used are
8# $RAI9RESR3A$I(9 $A71E
-# +ASSE96ER $A71E
8# TRAINRSR&ATION TABL: $is table contains te details of trains Suc as
train name ; Source Station ;Destination Station; Arrival $ime; Destination $ime ; 9o#of
seats #

-#"ASSN%R TABL: $is table contains te details of passenger8 suc as
$raveler name; train name ; date; source ;destination#

S!L 'Structure( !uer) Language*
S<1 =Structured <uery 1anguage> is a database computer language designed for managing data
in relational database management systems =RD7MS>; and originally based upon Relational
Algebra# Its scope includes data query and update; scema creation and modification; and data
access control#
$e most common operation in S<1 is te query; &ic is performed &it te declarative
SE1EC$ statement# SE1EC$ retrieves data from one or more tables; or e?pressions#
A query includes a list of columns to be included in te final result immediately follo&ing
te SE1EC$ 'ey&ord# An asteris' =@A@> can also be used to specify tat te query sould
return all columns of te queried tables# SE1EC$ is te most comple? statement in S<1;
&it optional 'ey&ords and clauses tat include:
$e FR(M clause &ic indicates te table=s> from &ic data is to be retrieved#
$e FR(M clause can include optional !(I9 subclauses to specify te rules for
%oining tables#
$e W0ERE clause includes a comparison predicate; &ic restricts te ro&s
returned by te query# $e W0ERE clause eliminates all ro&s from te result set
for &ic te comparison predicate does not evaluate to $rue#
$e follo&ing is an e?ample of a SE1EC$ query tat returns a list of trains available# $e
query retrieves all ro&s from te trainreservation in &ic te sourcr column contains a
value as lingampally# $e asteris' =A> in te select list indicates tat all columns of te
trainreservation table sould be included in te result set#
SE1EC$ A FR(M trainreservation W0ERE sourceBClingampallyCD
Data manipulation
$e Data Manipulation 1anguage =DM1> is te subset of S<1 used to add; update and
delete data:
I9SER$ adds ro&s =formally tuples> to an e?isting table; e#g#;: insert into
trainreservation=@1F8@;@0yd@;@lingampally@;-/;8/#,/;88#,/>D
insert into passenger=@?y5@;@1F8@;?;-82/,28/>D
"+DA$E modifies a set of e?isting table ro&s; e#g#;: "+DA$E passenger SE$
noofseatsB- W0ERE psgname B EsssED
DE1E$E removes e?isting ro&s from a table; e#g#;:
DE1E$E FR(M trainreservation W0ERE psgname B EsssED
Transaction controls
Transactions+ if a,aila-le+ DML operations:
C(MMI$ causes all data canges in a transaction to be made permanent#
R(117ACF causes all data canges since te last C(MMI$ or R(117ACF to
be discarded; leaving te state of te data as it &as prior to tose canges#
(nce te C(MMI$ statement completes; te transactionEs canges cannot be rolled bac'#
CommitD
Data (efinition
$e Data Definition 1anguage =DD1> manages table and inde? structure# $e most basic
items of DD1 are te CREA$E; A1$ER; RE9AME; DR(+ and $R"9CA$E statements:
CREA$E creates an ob%ect =a table; for e?ample> in te database#
Eg: create table trairnreservation=tname varcar=-/>;source varcar=-/>;Destination
varcar=-/>;9oofseats number=,>;arrival number=8-;->;departure number=8-;->>D
Eg:create table passenger=psgname varcar=-/>;tname varcar=-/>;9oofseats
number=,>;date varcar=-/>>D
DR(+ deletes an ob%ect in te database; usually irretrievably#
A1$ER modifies te structure of an e?isting ob%ect in various &aysGfor e?ample;
adding a column to an e?isting table#
Data control
$e Data Control 1anguage =DC1> autori5es users and groups of users to access and
manipulate data# Its t&o main statements are:
6RA9$ autori5es one or more users to perform an operation or a set of operations
on an ob%ect#
RE3(FE eliminates a grant; &ic may be te default grant#
A""LT
An applet is any small application tat performs one specific tas'D sometimes running &itin
te conte?t of a larger program; peraps as a plugin#
H8IH-I
0o&ever; te term typically also
refers to programs &ritten in te !ava programming language &ic are included in an
0$M1 page
All applets ave te follo&ing four metods:
public void init=>D
public void start=>D
public void stop=>D
public void destroy=>D
$ey ave tese metods because teir superclass; %ava#applet#Applet; as tese metods# =It
as oters too; but rigt no& I %ust &ant to tal' about tese four#>
In te superclass; tese are simply do2noting metods# For e?ample;
public void init=> JK
Subclasses may override tese metods to accomplis certain tas's at certain times# For
instance; te init=> metod is a good place to read parameters tat &ere passed to te applet
via L+ARAMM tags because itEs called e?actly once &en te applet starts up# 0o&ever; tey
do not ave to override tem# Since teyEre declared in te superclass; te Web bro&ser can
invo'e tem &en it needs to &itout 'no&ing in advance &eter te metod is
implemented in te superclass or te subclass# $is is a good e?ample of polymorpism#
$e init=> metod is called e?actly once in an appletEs life; &en te applet is first loaded# ItEs
normally used to read +ARAM tags; start do&nloading any oter images or media files you
need; and set up te user interface# Most applets ave init=> metods#
$e start=> metod is called at least once in an appletEs life; &en te applet is started or
restarted# In some cases it may be called more tan once# Many applets you &rite &ill not
ave e?plicit start=>metods and &ill merely inerit one from teir superclass# A start=>
metod is often used to start any treads te applet &ill need &ile it runs#
$e stop=> metod is called at least once in an appletEs life; &en te bro&ser leaves te page
in &ic te applet is embedded# $e appletEs start=> metod &ill be called if at some later
point te bro&ser returns to te page containing te applet# In some cases te stop=> metod
may be called multiple times in an appletEs life# Many applets you &rite &ill not ave e?plicit
stop=>metods and &ill merely inerit one from teir superclass# Nour applet sould use te
stop=> metod to pause any running treads# Wen your applet is stopped; it sould not use
any C+" cycles#
$e destroy=> metod is called e?actly once in an appletEs life; %ust before te bro&ser
unloads te applet# $is metod is generally used to perform any final clean2up# For
e?ample; an applet tat stores state on te server migt send some data bac' to te server
before itEs terminated# many applets &ill not ave e?plicit destroy=> metods and %ust inerit
one from teir superclass#
For e?ample; in a video applet; te init=> metod migt dra& te controls and start loading
te video file# $e start=> metod &ould &ait until te file &as loaded; and ten start playing
it# $e stop=> metod &ould pause te video; but not re&ind it# If te start=> metod &ere
called again; te video &ould pic' up &ere it left offD it &ould not start over from te
beginning# 0o&ever; if destroy=> &ere called and ten init=>; te video &ould start over from
te beginning#
In te !DFEs appletvie&er; selecting te Restart menu item calls stop=> and ten start=>#
Selecting te Reload menu item calls stop=>; destroy=>; and init=>; in tat order# =9ormally te
byte codes &ill also be reloaded and te 0$M1 file reread toug 9etscape as a problem
&it tis#>
$e applet start=> and stop=> metods are not related to te similarly named metods in te
%ava#lang#$read class#
Nour o&n code may occasionally invo'e start=> and stop=># For e?ample; itEs customary to
stop playing an animation &en te user clic's te mouse in te applet and restart it &en
tey clic' te mouse again#
Nour o&n code can also invo'e init=> and destroy=>; but tis is normally a bad idea# (nly te
environment sould call init=> and destroy=>#
!ava uses te standard; t&o2dimensional; computer grapics coordinate system# $e first
visible pi?el in te upper left2and corner of te applet canvas is =/; /># Coordinates increase
to te rigt and do&n#
6RA+0IC (7!EC$S:In !ava all dra&ing ta'es place via a 6rapics ob%ect# $is is an
instance of te class %ava#a&t#6rapics#
Initially te 6rapics ob%ect you use &ill be te one passed as an argument to an appletEs
paint=> metod# 1ater youEll see oter 6rapics ob%ects too# Everyting you learn today about
dra&ing in an applet transfers directly to dra&ing in oter ob%ects li'e +anels; Frames;
7uttons; Canvases and more#
Eac 6rapics ob%ect as its o&n coordinate system; and all te metods of 6rapics
including tose for dra&ing Strings; lines; rectangles; circles; polygons and more# Dra&ing in
!ava starts &it particular 6rapics ob%ect# Nou get access to te 6rapics ob%ect troug te
paint=6rapics g> metod of your applet# Eac dra& metod call &ill loo' li'e
g#dra&String=@0ello World@; /; ./> &ere g is te particular 6rapics ob%ect &it &ic
youEre dra&ing#
1oad image:Image img B tis#getImage=ne& "R1=@ttp:OO&&&#prenall#comOlogo#gif@>>D
$e getImage=> metod is provided by %ava#applet#Applet# $e "R1 class is provided by
%ava#net#"R1# 7e sure to import it#
Color is a class in te AW$# Individual colors li'e red or mauve are instances of tis class;
%ava#a&t#Color# 7e sure to import it if you &ant to use oter tan te default colors# Nou
create ne& colors using te same R67 triples tat you use to set bac'ground colors on &eb
pages# 0o&ever you use decimal numbers instead of te e? values used by 0$M1Es bgcolor
attribute# For e?ample medium gray is Color=8-4; 8-4; 8-4># +ure &ite is Color=-..; -..;
-..># +ure red is =-..; /; /> and so on# As &it any variable you sould give your colors
descriptive names# For instance
Color med6ray B ne& Color=8-4; 8-4; 8-4>D
Color cream B ne& Color=-..; -,8; 8P4>D
Color ligt6reen B ne& Color=/; ..; />D
A fe& of te most common colors are available by name# $ese are
Color#blac'
Color#blue
Color#cyan
Color#dar'6ray
Color#gray
Color#green
Color#ligt6ray
Color#magenta
Color#orange
Color#pin'
Color#red
Color#&ite
Color#yello&
Color oldColor B g#getColor=>D
g#setColor=Color#pin'>D
g#dra&String=@$is String is pin'Q@; ./; -.>D
g#setColor=Color#green>D
g#dra&String=@$is String is greenQ@; ./; ./>D
g#setColor=oldColor>D
Coosing a font face is easy# First you create a ne& Font ob%ect# $en you call g#setFont=Font
f># $o instantiate a Font ob%ect use tis constructor:
public Font=String name; int style; int si5e>
name is te name of te font family; e#g# @Serif@; @SansSerif@; or @Mono@#
si5e is te si5e of te font in points# In computer grapics a point is considered to be equal to
one pi?el# 8- points is a normal si5e font# 8R points is probably better on most computer
displays# Smaller point si5es loo' good on paper printed &it a ig resolution printer; but
not in te lo&er resolutions of a computer monitor#
style is an mnemonic constant from %ava#a&t#Font tat tells &eter te te?t &ill be bold;
italic or plain# $e tree constants are Font#+1AI9; Font#7(1D; and Font#I$A1IC# $e
program belo& prints eac font in its o&n face and 8R point bold#
A -asic e.ample using t/e 0a,a1applet pac2age
$e follo&ing e?ample is made simple enoug to illustrate te essential use of !ava applets
troug its %ava#applet pac'age# It also uses classes from te !ava Abstract Windo& $ool'it
=AW$> for producing actual output =in tis case; te @0ello; &orldQ@ message>#
import %ava#applet#AppletD
import %ava#a&t#AD
OO Applet code for te @0ello; &orldQ@ e?ample#
OO $is sould be saved in a file named as @0elloWorld#%ava@#
public class 0elloWorld e?tends Applet J
OO $is metod is mandatory; but can be empty =i#e#; ave no actual code>#
public void init=> J K

OO $is metod is mandatory; but can be empty#
public void stop=> J K

OO +rint a message on te screen =?B-/; yB8/>#
public void paint=6rapics g> J
g#dra&String=@0ello; &orldQ@; -/;8/>D
K
K
For compilation; tis code is saved on a plain2ASCII file &it te same name as te class and
#%ava e?tension; i#e# 0elloWorld#%ava# $e resulting 0elloWorld#class applet sould be
installed on te &eb server and is invo'ed &itin an 0$M1 page by using an LA++1E$M or
a LSCRI+$M tag# For e?ample:
LQD(C$N+E 0$M1 +"71IC
@2OOW,COOD$D 0$M1 R#/8 $ransitionalOOE9@ @ttp:OO&&&#&,#orgO$ROtmlROloose#dtd@M
L0$M1M
L0EADM
L$I$1EM0elloWorldSe?ample#tmlLO$I$1EM
LO0EADM
L7(DNM
L08MA !ava applet e?ampleLO08M
L+M0ere it is: LA++1E$ codeB@0elloWorld#class@ WID$0B@-//@ 0EI60$B@R/@M
$is is &ere 0elloWorld#class runs#LOA++1E$MLO+M
LO7(DNM
LO0$M1M
Displaying te 0elloWorldSe?ample#tml page from a Web server; te result sould loo' as
tis:
A !ava applet e?ample
0ere it is: 0ello; &orldQ
$o minimi5e do&nload time; applets are usually delivered in a form of compressed 5ip
arcive =aving %ar e?tension># If all needed classes =only one in our case> are placed in
compressed arcive e?ample#%ar; te embedding code &ould loo' differently:
L+M0ere it is: LA++1E$ codeB@0elloWorld@ WID$0B@-//@ 0EI60$B@R/@
ARC0I3EB@e?ample#%ar@M
$is is &ere 0elloWorld#class runs#LOA++1E$MLO+M
Advantages
A !ava applet can ave any or all of te follo&ing advantages:
It is simple to ma'e it &or' on 1inu?; Windo&s and Mac (S i#e# to ma'e it cross
platform# Applets are supported by most &eb bro&sers
$e same applet can &or' on @all@ installed versions of !ava at te same time; rater
tan %ust te latest plug2in version only# 0o&ever; if an applet requires a later version
of te !RE te client &ill be forced to &ait during te large do&nload#
Most &eb bro&sers cace applets; so &ill be quic' to load &en returning to a &eb
page# Applets also improve &it use: after a first applet is run; te !3M is already
running and starts quic'ly =!3M &ill need to restart eac time te bro&ser starts
fres>#
It can move te &or' from te server to te client; ma'ing a &eb solution more
scalable &it te number of usersOclients
If standalone program =li'e 6oogle Eart> tal's to te &eb server; tat server
normally needs to support also previous versions as te user may not 'eep it al&ays
updated# Differently; te bro&ser updates te applet so tere is no need to support te
legacy versions# (nly due configuration mista'es te applet may get stuc' in te
cace and ave issues &en ne& versions come out#
$e applet naturally supports te canging user state li'e figure positions on te
cessboard#
Developers can develop and debug an applet direct simply by creating a main routine
=eiter in te appletEs class or in a separate class> and call init=> and start=> on te
applet; tus allo&ing for development in teir favorite !-SE development
environment# All one as to do after tat is re2test te applet in te appletvie&er
program or a &eb bro&ser to ensure it conforms to security restrictions#
An untrusted applet as no access to te local macine and can only access te server
it came from# $is ma'es suc applet muc safer to run tan standalone e?ecutable
tat it could replace# 0o&ever signed applet can ave full access to te macine it is
running on if te user agrees#
Disadvantages
A !ava applet may ave any of te follo&ing disadvantages:
It requires te !ava plug2in#
Some organi5ations only allo& soft&are installed by te administrators# As a result;
some users can only vie& applets tat are important enoug to contact te
administrator as'ing to install te !ava plug2in#
As &it any client side scripting; security restrictions may ma'e difficult or even
impossible for untrusted applet to acieve te desired goals#
Some applets require a specific !RE# $is is discouraged
H--I
#
If applet requires ne&er or specific !RE tan available on te system; te user running
it first time &ill need to &ait for te large !RE do&nload to complete#
!ava automatic installation or update may fail if pro?y is used to access te &eb# $is
ma'es applet &it specific requirements impossible to run unless !ava is manually
updated# !ava automatic updater tat is part of !ava installation also may be comple?
to configure if it must &or' troug pro?y#
"nli'e te older applet tag; te ob%ect tag needs &or'arounds to &rite a cross2bro&ser
0$M1#
DATABAS CONNCTI&IT3:
!ava Database Connectivity =!D7C> provides !ava developers &it a standard A+I tat is
used to access databases; regardless of te driver and database product# $o use !D7C;
youEll need at least !DF 8#8; a database; and a !D7C driver# Installing te first t&o sould
be straigtfor&ard; but finding a !D7C driver requires a little more effort# !D7C presents
a uniform interface to databases 2 cange vendors and your applications only need to
cange teir driver#
$ere are plenty of drivers no& for !D7C tat support popular databases# If you can use a
!D7C driver tat &or's specifically for your database; ten tatEs greatQ If not; donEt
&orry 2 Sun provides a driver tat is compatible &it (D7C; so you sould be able to
connect to any (D7C compliant database# $e !D7C to (D7C bridge comes installed as
part of !DF8#8; so if tis is your target platform; te driver &ill already be installed#
NouEll need to create an (D7C datasource for your database; before your !ava
applications can access it#
Connecting to a database
In order to connect to a database; you need to perform some initiali5ation first# Nour
!D7C driver as to be loaded by te !ava 3irtual Macine classloader; and your
application needs to cec' to see tat te driver &as successfully loaded# WeEll be using
te (D7C bridge driver; but if your database vendor supplies a !D7C driver; feel free to
use it instead#
OO Attempt to load database driver
try
J
OO 1oad SunEs %dbc2odbc driver
Class#for9ame=@sun#%dbc#odbc#!dbc(dbcDriver@>#ne&Instance=>D
K
catc =Class9otFoundE?ception cnfe> OO driver not found
J
System#err#println =@"nable to load database driver@>D
System#err#println =@Details : @ T cnfe>D
System#e?it=/>D
K
We try to load te !dbc(dbcDriver class; and ten catc te Class9otFoundE?ception if
it is tro&n# $is is important; because te application migt be run on a non2Sun virtual
macine tat doesnEt include te (D7C bridge; suc as MicrosoftEs !3M# If tis occurs;
te driver &onEt be installed; and our application sould e?it gracefully#
(nce our driver is loaded; &e can connect to te database# WeEll connect via te driver
manager class; &ic selects te appropriate driver for te database &e specify# In tis
case; &eEll only be using an (D7C database; but in more comple? applications; &e migt
&is to use different drivers to connect to multiple databases# We identify our database
troug a "R1# 9o; &eEre not doing anyting on te &eb in tis e?ample 2 a "R1 %ust
elps to identify our database#
A !D7C "R1 starts &it @%dbc:@ $is indicates te protocol =!D7C># We also specify
our database in te "R1# As an e?ample; ereEs te "R1 for an (D7C datasource called
EdemoE# (ur final "R1 loo's li'e tis :
%dbc:odbc:demo
$o connect to te database; &e create a string representation of te database# We ta'e te
name of te datasource from te command line; and attempt to connect as user @dba@;
&ose pass&ord is @sql@#
OO Create a "R1 tat identifies database
String url B @%dbc:odbc:@ T argsH/ID
OO 9o& attempt to create a database connection
Connection dbSconnection B
DriverManager#getConnection =url; @dba@; @sql@>D
As you can see; connecting to a database doesnEt ta'e muc code#
E?ecuting database queries
In !D7C; &e use a statement ob%ect to e?ecute queries# A statement ob%ect is responsible
for sending te S<1 statement; and returning a set of results; if needed; from te query#
Statement ob%ects support t&o main types of statements 2 an update statement tat is
normally used for operations &ic donEt generate a response; and a query statement tat
returns data#
OO Create a statement to send S<1
Statement dbSstatement B dbSconnection#createStatement=>D
(nce you ave an instance of a statement ob%ect; you can call its e?ecute"pdate and
e?ecute<uery metods# $o illustrate te e?ecute"pdate command; &eEll create a table
tat stores information about employees# WeEll 'eep tings simple and limit it to name
and employee ID#
OO Create a simple table; &ic stores an employee ID and name
dbSstatement#e?ecute"pdate
=@create table employee J int id; car=./> name KD@>D
OO Insert an employee; so te table contains data
dbSstatement#e?ecute"pdate
=@insert into employee values =8; E!on DoeE>D@>D
OO Commit canges
dbSconnection#commit=>D
9o& tat tereEs data in te table; &e can e?ecute queries# $e response to a query &ill be
returned by te e?ecute<uery metod as a ResultSet ob%ect# ResultSet ob%ects store te
last response to a query for a given statement ob%ect# Instances of ResultSet ave metods
follo&ing te pattern of get** &ere ** is te name of a data type# Suc data types
include numbers =bytes; ints; sorts; longs; doubles; big2decimals>; as &ell as strings;
booleans; timestamps and binary data#
OO E?ecute query
ResultSet result B dbSstatement#e?ecute<uery
=@select A from employee@>D
OO Wile more ro&s e?ist; print tem
&ile =result#ne?t=> >
J
OO "se te getInt metod to obtain emp# id
System#out#println =@ID : @ T result#getInt=@ID@>>D
OO "se te getString metod to obtain emp# name
System#out#println =@9ame : @ T result#getString=@9ame@>>D
System#out#println =>D
K
SAM+1E: A !ava applet tat use !D7C applet driver to access a database
$is sample so&s o& to &rite a !ava Applet tat uses te
!D7C $ype , and R driver to access a D7- database#
7y default; tis sample uses !D7C $ype R driver to connect to
te @sample@ database =Recommended># Run tis sample using te
follo&ing steps:
8# Create and populate te @sample@ database &it te follo&ing
command: db-sampl
-# Customi5e Applt#tml &it your server; port; user ID; and
pass&ord# Refer to Applt#tml for details#
,# Compile te program &it te follo&ing command:
%avac Applt#%ava
Alternatively; you can compile te program &it te follo&ing
command if you ave a compatible ma'eOnma'e program on
your system:
ma'eOnma'e Applt
R# Ensure tat your &or'ing directory is accessible by your &eb
bro&ser# If it is not; copy Applt#class and Applt#tml into
a directory tat is accessible#
.# $o use te !D7C $ype R driver; copy sqllibU%avaUdb-%cc#%ar on
Windo&s or sqllibO%avaOdb-%cc#%ar on "9I*; into te same
directory as Applt#class and Applt#tml#
V# $o run tis sample; start your &eb bro&ser =&ic must support
!ava 8#,> and load Applt#tml on your client macine#
Nou can vie& it locally &it te follo&ing command:
appletvie&er Applt#tml
CLI"S #OR4IN%:
8# Eclipse (vervie&
Eclipse an open source community &ose pro%ects building tools and frame&or's for
creating general purpose application#
$e most popular usage of Eclipse is as a !ava development environment &ic &ill be
described in tis article#
- 8#Installation
Do&nload @Eclipse IDE for !ava Developers@ from te &ebsite Eclipse Do&nloads and
unpac' it to a directory# $is is sufficient for Eclipse to be usedD no additional installation
procedure is required#
"se a directory pat &ic does not contain spaces in its name#
Eclipse requires an installed !ava Runtime# I recommended to use !ava V =also 'no&n as
!ava 8#V>#
-#-# Start Eclipse
$o start Eclipse double2clic' on te file eclipse#e?e in your installation directory#
$e system &ill prompt you for a &or'space# $e &or'space is te place tere you store
your !ava pro%ects =more on &or'spaces later># Select a suitable =empty> directory and
press ('#
Eclipse &ill start and so& te Welcome page#
Close te &elcome page by press in little ? besides te Welcome#
,# Eclipse "I (vervie&
Eclipse provides perspectives; vie&s and editors# 3ie&s and editors are grouped into
perspectives# All pro%ects are located in a &or'space#
,#8# Wor'space
$e &or'space is te pysical location =file pat> you are &or'ing in# Nou can coose te
&or'space during startup of eclipse or via te menu =File2M S&itc Wor'space2M (ters>#
All your pro%ects; sources files; images and oter artifacts &ill be stored and saved in
your &or'space#
$o predefine te &or'space you can use te startup parameter 2data patStoS&or'space;
e#g# c:Ueclipse#e?e 2data @c:Utemp@ +lease note tat you ave to put te pat name into
brac'ets#
$o see te current &or'space directory in te title of Eclipse use 2so&1ocation as
additional parameter#
,#-# +erspective
A perspective is a visual container for a set of vie&s and editors#
Nou can cange te layout &itin a perspective =close O open vie&s; editors; cange te
si5e; cange te position; etc#>
A common problem is tat you closed a vie& and donEt 'no& o& to re2open tis vie&#
Nou can reset a perpective it to it original state via te menu @Windo&@ 2M @Reset
+erspective@#
Eclipse allo& you to s&itc to anoter perspective via te menu Windo&2M(pen
+erspective 2M (ter#
For !ava development you usually use te @!ava +erspective@#
,#,# 3ie&s and Editors
A vie& is typically used to navigate a ierarcy of information or to open an editor#
Canges in a vie& are directly applied#
Editors are used to modify elements# Editors can ave code completion; undo O redo; etc#
$o apply te canges in an editor to te underlying resources; e#g# !ava source file; you
usually ave to save#
51 Create )our first 6a,a program
$e follo&ing &ill describe o& to create a minimal !ava program using Eclipse# It &ill
be te classical @0ello World@ program# (ur program &ill &rite @0ello EclipseQ@ to te
console#
5171 Create pro0ect
Select from te menu File 2M 9e&2M !ava pro%ect# Maintain @de#vogella#eclipse#ide#first@
as te pro%ect name# Select @Create separate source and output folders@#
+ress finis to create te pro%ect# A ne& pro%ect is created and displayed as a folder# (pen
te folder @de#vogella#eclipse#ide#first@
5181 Create pac2age
Create no& a pac'age# A good convention is to use te same name for te top pac'age as
te pro%ect# Create terefore te pac'age @de#vogella#eclipse#ide#first@#
Select te folder src; rigt mouse clic' on it and select 9e& 2M +ac'age#
5191 Create 6a,a class
Rigt clic' on your pac'age and select 9e& 2M Class
Create MyFirstClass; select te flag @public static void main =StringHI args>@
Maintain te follo&ing code#
pac'age de#vogella#eclipse#ide#firstD
public class MyFirstClass J
public static void main=StringHI args> J
System#out#println=@0ello EclipseQ@>D
K
K
5151 Run )our pro0ect in clipse
9o& run your code# Rigt clic' on your !ava class and select Run2as2M !ava application
FinisedQ Nou sould see te output in te console#
R#.# Run your !ava program outside Eclipse =create %ar file>
$o run your !ava program outside of Eclipse you need to e?port it as a %ar file# Select
your pro%ect; rigt clic' on it and select @E?port@#
Select !AR file; select ne?t# Select your pro%ect and maintain te e?port destination and a
name for te %ar file# I named it @myprogram#%ar@#
+ress finis# $is &ill create a %ar file in your select output directory#
51:1 Run )our program outsi(e clipse
(pen a command sell; e#g# under Microsoft Windo&s select Start 2M Run and type in
cmd# $is sould open a consle#
S&itc to your output directory; e#g# by typing cd pat; e#g# if you %ar is located in
@c:Utemp@ type @cd c:Utemp@#
$o run tis program you need to include te %ar file into your classpat# See Classpat
and !ava !AR Files for details#
%ava 2classpat myprogram#%ar de#vogella#eclipse#ide#first#MyFirstClass
UML DIA%RAMS:
"M1 stands for "nified Modeling 1anguage# $is ob%ect2oriented system of
notation as evolved from te &or' of 6rady 7ooc; !ames Rumbaug; Ivar !acobson;
and te Rational Soft&are Corporation# $ese reno&ned computer scientists fused teir
respective tecnologies into a single; standardi5ed model# $oday; "M1 is accepted by te
(b%ect Management 6roup =(M6> as te standard for modeling ob%ect oriented
programs#
C1ASS DIA6RAM: Class diagram is a collection set of ob%ects#


FI%7:CLASS DIA%RAM FOR RAIL#A3 RSR&ATION
USCAS DIA%RAM:
"se case diagrams model te functionality of system using
actors and use cases
S!UNC DIA%RAM:
Sequence diagrams describe interactions among classes in terms of an e?cange of
messages over time#
D"LO3MNT DIA%RAM:
Deployment diagrams depict te pysical resources in a system; including nodes;
components; and connections# Component diagrams describe te organi5ation of pysical
soft&are components; including source code; run2time =binary> code; and e?ecutables#
COM"ONNT DIA%RAM:
Component diagrams describe te organi5ation of pysical soft&are
components; including source code; run2time =binary> code; and e?ecutables#
IM"LMNTATION:
CODIN%:
<HTML>
<HEAD>
<TITLE>RESERVATION</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/t!"# $%&'et=('o-))*+-,">
<'$&(pt type="text/-%.%S$&(pt">
</--
01n$t(on MM231!pMen14t%&56'e"O736&e'to&e89 //.:;<

e.%"4t%&5=";"o$%t(on=>"='e"O73;opt(on'?'e"O73;'e"e$te@In@exA;.%"1e=">"8#
(0 4&e'to&e8 'e"O73;'e"e$te@In@ex=<#
B
//-->
</'$&(pt>
<'ty"e type="text/$''">
</--
;'ty"e, 9$o"o&C DEEEEEEB
;'ty"eF 9$o"o&C D<<<<EEB
%Co.e& 9
$o"o&C D<<EE<<#
text-@e$o&%t(onC none#
B
%C"(nG 9
text-@e$o&%t(onC none#
B
%C.('(te@ 9
text-@e$o&%t(onC none#
B
%C%$t(.e 9
text-@e$o&%t(onC none#
B
-->
</'ty"e>
</HEAD>
<HODI HJCOLOR=DEEEEEE LEETMARJIN=< TOPMARJIN=< MARJINKIDTH=<
MARJINHEIJHT=<>
<TAHLE %"(5n="$ente&"KIDTH=L+F HORDER=< CELLPADDINJ=< CELLSPACINJ=<>
<TR>
<TD COLSPAN=) ROKSPAN=F>
<IMJ SRC="(!%5e'/RESERVATION2<,;5(0" KIDTH=,LM
HEIJHT=,F, ALT=""></TD>
<TD COLSPAN=:>
<IMJ SRC="(!%5e'/RESERVATION2<F;5(0" KIDTH=N,:
HEIJHT=, ALT=""></TD>
<TD COLSPAN=F ROKSPAN=F>
<IMJ SRC="(!%5e'/RESERVATION2<:;5(0" KIDTH=F<:
HEIJHT=,F, ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=F>
<IMJ SRC="(!%5e'/RESERVATION2<N;3p5" KIDTH=N,,
HEIJHT=,F< ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/RESERVATION2<*;5(0" KIDTH=F
HEIJHT=,F< ALT=""></TD>
</TR>
<TR>
<TD ROKSPAN=M>
<IMJ SRC="(!%5e'/RESERVATION2<M;5(0" KIDTH=F
HEIJHT=F:* ALT=""></TD>
<TD COLSPAN=L 75$o"o&="D)L<*<*">On7'p#</TD>
<TD ROKSPAN=: %"(5n="$ente&" 75$o"o&="D)L<*<*"><'p%n
$"%''="'ty"e,"><'t&on5></'p%n><'t&on5><% &e0="R%("P%y-
Re'e&.%t(on;t!""><0ont $o"o&="DEEEEEE">Ho!e</0ont></%></'t&on5><'p%n
$"%''="'ty"e,"><'t&on5> QQ <% &e0="'(te!%p;t!""><0ont
$o"o&="DEEEEEE">S(te M%p</0ont></%> QQ <'p%n $"%''="'ty"e,"><%
&e0="&%("-!%p;3p5"><0ont $o"o&="DEEEEEE">R%("P%y M%p</0ont></%> QQ <%
&e0="(!%5e;t!""><0ont $o"o&="DEEEEEE">I!%5e'</0ont></%>
</'t&on5></'p%n><'t&on5>On7'p#</'t&on5></TD>
<TD COLSPAN=: ROKSPAN=: 75$o"o&="D)L<*<*">On7'p#</TD>
<TD ROKSPAN=: 75$o"o&="D)L<*<*">On7'p#</TD>
</TR>
<TR>
<TD COLSPAN=L 75$o"o&="D)L<*<*">
<IMJ SRC="(!%5e'/RESERVATION2,,;5(0" KIDTH=,LN
HEIJHT=, ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=F ROKSPAN=F 75$o"o&="D)L<*<*">
<IMJ SRC="(!%5e'/RESERVATION2,F;5(0" KIDTH=:
HEIJHT=,F ALT=""></TD>
<TD COLSPAN=: ROKSPAN=F 75$o"o&="D)L<*<*">
<IMJ SRC="(!%5e'/RESERVATION2,:;5(0" KIDTH=,F+
HEIJHT=,F ALT=""></TD>
<TD COLSPAN=F 75$o"o&="D)L<*<*">
<IMJ SRC="(!%5e'/RESERVATION2,N;5(0" KIDTH=NF
HEIJHT=F ALT=""></TD>
</TR>
<TR>
<TD>
<IMJ SRC="(!%5e'/RESERVATION2,*;5(0" KIDTH=,
HEIJHT=,< ALT=""></TD>
<TD COLSPAN=M ROKSPAN=*
7%$G5&o1n@="(!%5e'/RESERVATION2,M;5(0" KIDTH=M*L HEIJHT=NMN
ALT=""><(0&%!e
e(5t=NM< '&$="%.%("%7("(ty,;t!""
0&%!e7o&@e&=< P(@t=M** n%!e=t&%(n
'$&o""(n5=ye'> </(0&%!e></TD>
</TR>
<TR>
<TD ROKSPAN=F>
<IMJ SRC="(!%5e'/RESERVATION2,L;5(0" KIDTH=F
HEIJHT=,+) ALT=""></TD>
<TD COLSPAN=*>
<IMJ SRC="(!%5e'/RESERVATION2,);5(0" KIDTH=,:,
HEIJHT=F) ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=F>
<IMJ SRC="(!%5e'/RESERVATION2,+;5(0" KIDTH=,<
HEIJHT=,L< ALT=""></TD>
<TD><t%7"e P(@t=",<L" 7o&@e&="<">
<t&>
<t@ %"(5n="$ente&"><'p%n $"%''="'ty"eN 'ty"eF"><%
&e0="t&%(n'$e@1"e;t!"">T&%(n S$e@1"e</%> </'p%n></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'p%n $"%''="'ty"eN 'ty"eF"><%
&e0="t%tG%";t!"">T%tG%" S$e!e</%> </'p%n></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'p%n $"%''="'ty"eN 'ty"eF"><%
&e0="o00($e(n(n@(%;t!"">O00($e (n In@(%</%> </'p%n></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'p%n $"%''="'ty"eN 'ty"eF"><%
&e0="%.%("%7("(ty;t!"">A.%("%7("(ty</%></'p%n></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'p%n $"%''="'ty"eF"></'p%n></t@>
</t&>
</t%7"e></TD>
<TD COLSPAN=F ROKSPAN=:>
<IMJ SRC="(!%5e'/RESERVATION2F,;5(0" KIDTH=+
HEIJHT=NFM ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=*>
<IMJ SRC="(!%5e'/RESERVATION2FF;5(0" KIDTH=,FM
HEIJHT=:< ALT=""></TD>
</TR>
<TR>
<TD COLSPAN=N>
<IMJ SRC="(!%5e'/RESERVATION2F:;5(0" KIDTH=,N
HEIJHT=FFM ALT=""></TD>
<TD 7%$G5&o1n@="(!%5e'/RESERVATION2FN;5(0" KIDTH=,,F
HEIJHT=FFM ALT=""><t%7"e P(@t=",,<" 7o&@e&="<">
<t&>
<t@ %"(5n="$ente&"><'t&on5>T&%(n -In0o </'t&on5></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><0o&! n%!e="0o&!F">
<'e"e$t n%!e="!en1F"
onC%n5e="MM231!pMen14>p%&ent>6t('6<8">
<opt(on 'e"e$te@>Se"e$t</opt(on>
<opt(on .%"1e="&%3@%n(;t!"">R%3@%n(</opt(on>
<opt(on .%"1e="'%t%7@(;t!"">S%t%7@(</opt(on>
<opt(on .%"1e="to1&('t;t!"">To1&('t</opt(on>
<opt(on .%"1e="5%&(7&%t;t!"">J%&(7&%t</opt(on>
</'e"e$t>
</0o&!> </t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'t&on5>V(eP Co@e </'t&on5></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><0o&! n%!e="0o&!:">
<'e"e$t n%!e="!en1:"
onC%n5e="MM231!pMen14>p%&ent>6t('6<8">
<opt(on>'e"e$t</opt(on>
<opt(on .%"1e="R1ot%;t!"">Q1ot%</opt(on>
<opt(on .%"1e="$"%'',;t!"">C"%''</opt(on>
<opt(on .%"1e="'t%t(on;t!"">St%t(on</opt(on>
</'e"e$t>
</0o&!> </t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><'t&on5>R1"e'</'t&on5></t@>
</t&>
<t&>
<t@ %"(5n="$ente&"><0o&! n%!e="0o&!,">
<'e"e$t n%!e="!en1,"
onC%n5e="MM231!pMen14>p%&ent>6t('6<8">
<opt(on 'e"e$te@>Se"e$t</opt(on>
<opt(on .%"1e="RESERVATION;t!"">Re'e&.%t(on</opt(on>
<opt(on .%"1e="&e01n@;t!"">Re01n@</opt(on>
<opt(on .%"1e=""%551%5e;t!"">L%551%5e</opt(on>
</'e"e$t>
</0o&!> </t@>
</t&>
</t%7"e></TD>
</TR>
<TR>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=F HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=F HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=, HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=+ HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=,,F HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=) HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=, HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=N, HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=:,* HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=+M HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=F HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=** HEIJHT=,
ALT=""></TD>
<TD>
<IMJ SRC="(!%5e'/'p%$e&;5(0" KIDTH=,N) HEIJHT=,
ALT=""></TD>
</TR>
</TAHLE>
</-- En@ I!%5eRe%@y S"($e' -->
</HODI>
</HTML>
TSTIN%
$e testing pase is an important part of soft&are development# It is te process of
finding errors and missing operations and also a complete verification to determine
&eter te ob%ectives are met and te user requirements are satisfied# Soft&are testing is
carried out in tree steps:
$e first includes unit testing; &ere in eac module is tested to provide its correctness;
validity and also determine any missing operations and to verify &eter te ob%ectives
ave been met# Errors are noted do&n and corrected immediately# "nit testing is te
important and ma%or part of te pro%ect# So errors are rectified easily in particular module
and program clarity is increased# In tis pro%ect entire system is divided into several
modules and is developed individually# So unit testing is conducted to individual
modules#
$e second step includes Integration testing# It need not be te case; te soft&are &ose
modules &en run individually and so&ing perfect results; &ill also so& perfect results
&en run as a &ole# $e individual modules are clipped under tis ma%or module and
tested again and verified te results# $is is due to poor interfacing; &ic may results in
data being lost across an interface# A module can ave inadvertent; adverse effect on any
oter or on te global data structures; causing serious problems#
$e final step involves validation and testing &ic determines &ic te soft&are
functions as te user e?pected# 0ere also some modifications &ere# In te completion of
te pro%ect it is satisfied fully by te end user#
RSULTS:

ScreenS/ots:
71 $ome page :

81Train Details:
91C/ec2 t/e a,aila-ilit) of seats:
51After -oo2ing t/e tic2et:
.#+RI9$I96 $ICFE$:
:1Seats not a,aila-le:
;1Testcase<7 ScreenS/ot:
=:Testcase<8 ScreenS/ot:
>1Screen s/ot for seats are not a,aila-le:
CONCLUSION
In te last &e conclude tat MM$s Rail&ays is aving a strong I$ Infrastructure
and a &ell equipped rail&ay reservation system but tere is some sortcoming in te
system on &ic &e ave tried to &or' on it and successfully completed our pro%ect#
FUTUR SCO"
If anyone &ants tis pro%ect ten e or se can ma'e an additional database of
$RAI9FARE# And database for update availability of seats &ic is available after te
cancellation of tic'et on tat specific train # etc#
0e or se can also add some command buttons in te e?isting soft&are and
e?tend &or'ing of te soft&are#