Sei sulla pagina 1di 70

AIRLINE RESERVATION SYSTEM

A PROJECT REPORT Submitted by

T.S.S.N.SAILAJA V.KRISHNA CHAITANYA V.SURYA INDIRA Y.SRI RAMYA

103678123 103678128 103678137 103679143

In partial fulfillment for the award of the degree of

B.Te !
In Mini Proje t !ab COM"UTER SCIENCE "nder the e#teemed $uidan e of

"#$%.C!. R&'& R&(e)! M.Te !* +"!D,

RE-ENCY INSTITUTE O. TECHNOLO-Y ADAVI"OLAM* YANAM/033464 De1&#2(e32 $% C$(142e# S 5e3 e &36 E3753ee#537
M&# !/2012
%

DECLARATION BY THE CANDIDATE


I here by de lare that the proje t report entitled & AIRLINE RESERVATION SYSTEM' #ubmitted by me to Regen y In#titute of Te hnology( )anam in partial fulfillment of the re*uirement for the award of the degree of B.TECH in COMP"TER SCIE+CE ,EPARTME+T i# a re ord of bonfide proje t wor- arried out by me under the guidan e of Mr. C/. RAJA RAMES/. I further de lare that the wor- reported in thi# proje t ha# not been #ubmitted and will not be #ubmitted0 either in part or in full0 for the award of any other degree or diploma in thi# in#titute or any other in#titute or uni1er#ity.

)anam ,ate2

Signature of the Candidate

BONA.IDE CERTI.ICATE
Thi# i# to SYSTEM' ertify that the proje t report entitled & AIRLINE RESERVATION #ubmitted by T.S.S.N.SAILAJA 81036781239* V.KRISHNA

CHAITANYA 81036781289* V.SURYA INDIRA 81036781379* Y.SRI RAMYA 81036781439 to Regen y In#titute of Te hnology0 )anam in partial fulfillment of the re*uirement for the award of the degree of B.TECH in COM"UTER SCIENCE DE"ARTMENT i# a re ord of bonafide wor- arried out by him4her under my guidan e. The proje t fulfill# the re*uirement# a# per the regulation# of thi# In#titute and in my opinion meet# the ne e##ary #tandard# for #ubmi##ion. The ontent# of thi# report ha1e not been #ubmitted and will not be #ubmitted either in part or in full0 for the award of any other degree or diploma in thi# in#titute or any other in#titute or uni1er#ity.

5Signature of the Coordinator6 5+ame6 COOR,I+ATOR ,ate2

5Signature of the Super1i#or6

,ate2

5Signature6 E7ternal E7aminer 8#9

5Signature6 Internal E7aminer 8#9

ACKNO:LED-EMENT
&Ta#- #u e##ful' ma-e# e1eryone happy. ;ut the happine## will be gold without glitter if we didn<t #tate the per#on# who ha1e #upported u# to ma-e it a #u e##. Su e## will be rowned to people who made it a reality but the people who#e on#tant guidan e and en ouragement made it po##ible will be rowned fir#t on the e1e of #u e##. Thi# a -nowledgment tran# end# the reality of formality when we would li-e to e7pre## deep gratitude and re#pe t to all tho#e people behind the # reen who guided0 in#pired and helped me for the ompletion of our proje t wor-. =e on#ider our#el1e# lu -y enough to get #u h a good proje t. Thi# proje t would add a# an a##et to my a ademi profile. =e e7pre## our #in ere gratitude to our re#pe tful Prin ipal D#.".K4(&# B&;4 and dean D#. A. R&(&<#5)!3& R&$ for enabling u# to ma-e u#e of laboratory and library fa ilitie# liberally0 that helped u# a long way in #u e##fully. =e e7pre## our gratitude to the help of the /ead of the ,epartment of Computer S ien e and Engineering0 M#. S. T. V. S. K4(&#* M.Te !* 8"!. D9 0 for hi# on#tant #uper1i#ion0 guidan e and o>operation throughout the proje t and we would li-e to e7pre## our than-fulne## to our proje t guide0 M#.C!. R&'& R&(e)!* M.Te !*8"!.D9 for hi# on#tant moti1ation and 1aluable help through the proje t wor-. =e e7tend our #in ere gratitude to our parent# who ha1e en ouraged u# with their ble##ing# to do thi# proje t #u e##fully. ?inally we would li-e to than- to all our friend#0 all the tea hing and non>tea hing #taff member# of the CSE ,epartment0 for all the timely help0 idea# and en ouragement whi h helped throughout in the ompletion of proje t. arrying out our proje t wor-

I N D E=
Ab#tra t !i#t of Table# !i#t of ?igure# %. Introdu tion 3. O1er1iew of Propo#ed #y#tem 3.% E7iting Sy#tem 3.3 Propo#ed Sy#tem :. Sy#tem Analy#i# :.% ?ront End :.3 ;a - End :.: Module# @. Sy#tem ,e#ign @.% "M! @.%.% Cla## ,iagram @.%.3 A ti1ity ,iagram @.%.: Se*uen e ,iagram @.%.@ "#e Ca#e ,iagram @.%.F Collaboration ,iagram @.%.E ,ataflow @.3 ,ata ,i tionary @.3.% Introdu tion @.3.3 ,ata ,i tionary F. Implementation E. E7perimental Re#ult# A. Te#ting A.% Introdu tion A.3 Type of Te#ting A.3.% "nit Te#ting F A B B C %D %D %% %3 %3 :D :@ :E :A :A :A :A :B :B :C @: @: @: @C ED EA EA EA EB

A.3.3 Integrated Te#ting A.3.: Re o1ery Te#ting A.3.@ Se urity Te#ting A.3.F Performan e Te#ting A.3.E =hite>bo7 Te#ting B. Con lu#ion C. Referen e# EB EB EC EC AD A%

ABSTRACT>
Airline re#er1ation #y#tem# were fir#t introdu ed in the late %CFD# a# relati1ely #imple #tandalone #y#tem# to ontrol flight in1entory0 maintain flight # hedule#0 #eat a##ignment# and air raft loading. The modern airline re#er1ation #y#tem i# omprehen#i1e #uite of produ t# to pro1ide a #y#tem that a##i#t# with a 1ariety of airline management ta#-# and #er1i e u#tomer need# from the time of initial re#er1ation through ompletion of the flight. One of the mo#t ommon mode# of tra1el i# tra1eling by air. Cu#tomer# who wi#h to tra1el by air nowaday# ha1e a wide 1ariety of airline# and a range of timing# to hoo#e from. +owaday# ompetition i# #o fier e between airline# that there are lot of di# ount# and a lot of lu7urie# gi1en to u#tomer# that will gi1e an edge to that parti ular airline. The =orld =ide =eb ha# be ome tremendou#ly popular o1er the la#t four year#0 and urrently mo#t of the airline# ha1e made pro1i#ion for online re#er1ation of their flight#. The Internet ha# be ome a major re#our e for people loo-ing for ma-ing re#er1ation# online without the ha##le of meeting tra1el agent#. My Proje t intend# to #er1e the#e purpo#e#. It intend# to he - all the a1ailable airline databa#e# and return a #tring of re#ult#0 whi h an help them in their tra1el plan#. The obje ti1e of thi# proje t i# to reate an airline re#er1ation #y#tem where a tra1eler an re*ue#t all flight information a# per their journey date#. They an get information regarding time0 o#t0 et all at the #ame time and pla e. =hen the u#tomer all# the Counter A##i#tant for hi#4her tra1el need#0 the ounter a##i#tant will enter the u#tomerG# detail# 8flight re*uirement#9 in the #y#tem. The #y#tem di#play# all the a1ailable airline#0 # hedule# and pri e#. Thi# #y#tem would help the airline to better #er1e it# u#tomer# by atering to their need#. The #ite would u#e a ,ataba#e to hold thi# information a# well a# the late#t pri ing and a1ailability information for the airline#.

LIST O. TABLES>
Can ellation table Cla##e# table ?light day# ?light ,etail# !ogin Mail +ew "#er Pa##enger Payment Re#er1ation

LIST O. .I-URES>
Cla## ,iagram A ti1ity ,iagram Se*uen e ,iagram "#e Ca#e ,iagram Collaboration ,iagram

1. INTRODUCTION>
Airline re#er1ation #y#tem# were fir#t introdu ed in the late %CFD# a# relati1ely #imple #tandalone #y#tem# to ontrol flight in1entory0 maintain flight # hedule#0 #eat a##ignment# and air raft loading. The modern airline re#er1ation #y#tem i# omprehen#i1e #uite of produ t# to pro1ide a #y#tem that a##i#t# with a 1ariety of airline management ta#-# and #er1i e u#tomer need# from the time of initial re#er1ation through ompletion of the flight. One of the mo#t ommon mode# of tra1el i# tra1eling by air. Cu#tomer# who wi#h to tra1el by air nowaday# ha1e a wide 1ariety of airline# and a range of timing# to hoo#e from. +owaday# ompetition i# #o fier e between airline# that there are lot of di# ount# and a lot of lu7urie# gi1en to u#tomer# that will gi1e an edge to that parti ular airline. The =orld =ide =eb ha# be ome tremendou#ly popular o1er the la#t four year#0 and urrently mo#t of the airline# ha1e made pro1i#ion for online re#er1ation of their flight#. The Internet ha# be ome a major re#our e for people loo-ing for ma-ing re#er1ation# online without the ha##le of meeting tra1el agent#. My Proje t intend# to #er1e the#e purpo#e#. It intend# to he - all the a1ailable airline databa#e# and return a #tring of re#ult#0 whi h an help them in their tra1el plan#. The obje ti1e of thi# proje t i# to reate an airline re#er1ation #y#tem where a tra1eler an re*ue#t all flight information a# per their journey date#. They an get information regarding time0 o#t0 et all at the #ame time and pla e. =hen the u#tomer all# the Counter A##i#tant for hi#4her tra1el need#0 the ounter a##i#tant will enter the u#tomerG# detail# 8flight re*uirement#9 in the #y#tem. The #y#tem di#play# all the a1ailable airline#0 # hedule# and pri e#. Thi# #y#tem would help the airline to better #er1e it# u#tomer# by atering to their need#. The #ite would u#e a ,ataba#e to hold thi# information a# well a# the late#t pri ing and a1ailability information for the airline#.

2 . O V E RV I E : O . T H E " RO J E C T >
The main purpo#e of thi# #oftware i# to redu e the manual error# in1ol1ed in the airline re#er1ation pro e## and ma-e it on1enient for the u#tomer# to boo- the flight# a# when they re*uire #u h that they an utiliHe thi# #oftware to ma-e re#er1ation0 modify re#er1ation# or an el a parti ular re#er1ation. The name of the #oftware i# &AIR!I+E RESERIATIO+ S)STEM'. Thi# #oftware pro1ide# option# for 1iewing different flight# a1ailable with different timing# for a parti ular date and pro1ide# u#tomer# with the fa ility to boo- a ti -et0 modify or an el a parti ular re#er1ation but it doe# not pro1ide the u#tomer# with detail# of o#t of the ti -et and it doe# not allow the u#tomer to modify a parti ular part of hi# re#er1ation and he4#he an modify all detail#. 3.% E=ISTIN- SYSTEM> The effe ti1ene## of the #y#tem depend# on the way in whi h the data i# organiHed .In the e7i#ting #y#tem0 mu h of the data i# entered manually and it an be 1ery time on#uming. =hen re ord# are a e##ed fre*uently0 managing #u h re ord# be ome# diffi ult. Therefore organiHing data be ome# diffi ult. The major limitation# are2 Modifi ation# are ompli ated Mu h time on#uming Error prone "nauthoriHed a e## of data

2.2 "RO"OSED SYSTEM> The propo#ed #y#tem i# better and more effi ient than e7i#ting Sy#tem by -eeping in mind all the drawba -# of the pre#ent #y#tem to pro1ide a permanent to them. The primary aim of the new #y#tem i# to #peed up the tran#a tion#. "#er friendline## i# another pe uliarity of the propo#ed #y#tem. Me##age# are di#played in me##age bo7e# to ma-e the #y#tem u#er friendly. The main Ad1antage of the propo#ed %D

#y#tem i# the redu tion in labor a# it will be po##ible #o #ear h the detail# of 1ariou# pla e#. E1ery re ord i# he -ed for ompletene## and a ura y and then it i# entered into the databa#e. The omment# and 1alid me##age# are pro1ided to get away redundant data. Another important feature of the propo#ed #y#tem i# the data #e urity pro1ided by the #y#tem. The main obje ti1e# of the propo#ed #y#tem are2 Comple7 fun tion# are done automati ally Pro e##ing time an be minimiHed Simple and ea#y to manage Chan e# of error# redu ed ?a#ter and more a urate than the e7i#ting #y#tem Ea#y for handling report#

The propo#ed #y#tem i# omplete #oftware for Airline Re#er1ation Sy#tem0 =hi h i# more effi ient0 reliable0 fa#ter and a urate for pro e##ing.

%%

3. SYSTEM ANALYSIS>
3.1 .RONT END 8JAVA9 O?e#?5e@ $% J&?&> Ja1a i# a powerful but lean obje t oriented programming language. It ha# generated a lot of e7 itement be au#e it ma-e# it po##ible to program for Internet by reating applet#0 program# that an be embedded in wed page. The onte7t of an applet i# limited only by one# imagination. Applet# an be ju#t little de oration# to li1en up web page0 or they an be #eriou# appli ation# li-e word pro e##or# or #pread#heet. ;ut Ja1a i# more than programming language for writing applet#. It i# be oming #o popular that many people belie1e it will be ome #tandard language for both general purpo#e# and Internet programming. J&?& %#$( CAA> Ja1a build# on the #trength of CJJ. It ha# ta-en the be#t feature# of CJJ and di# arded the more problemati and error prone part#. To thi#0 it ha# added garbage olle tion 8automati memory management90 multi threading 8the apa ity for one program to do more than one thing at a time9 and #e urity apabilitie#. The re#ult i# that Ja1a i# #imple0 elegant0 powerful and ea#y to u#e. Ja1a i# a tually a platform on#i#ting of three omponent#2 Ja1a Programming !anguage. Ja1a library of la##e# and interfa e#. Ja1a 1irtual Ma hine.

;ut Ja1a i# more than programming language for writing applet#. It i# be oming #o popular that many people belie1e it will be ome #tandard language for both general purpo#e and Internet programming.

%3

C$(1$3e32) $% J&?&> Ja1a i# a tually a platform on#i#ting of three omponent#2 Ja1a Programming !anguage. Ja1a !ibrary of la##e# and interfa e#. Ja1a Iirtual Ma hine.

J&?& 5) O;'e 2 O#5e32e6> The Ja1a programming language i# obje t oriented0 whi h ma-e# program de#ign fo u# on what you are dealing with rather than on how you are going to do #omething. Thi# ma-e# it more u#eful for programming in #ophi#ti ated proje t# be au#e one an brea- the thing# down into under#tandable omponent#. Reu#ability of the#e omponent# i# another big benefit. Obje t oriented language# u#e the paradigm of la##e#. In #imple term#0 a la## in lude# both the data and the fun tion# to operate on that data. Obje t i# an in#tan e of the la## form# the a tual run time entity of the la##. En ap#ulation of ode and date ma-e# it po##ible it ma-e the hange# in ode without brea-ing other program# that u#e that ode. Ja1a in lude# inheritan e0 or the ability to deri1e new la##e# form e7i#ting la## referred to a# the parent la##. A #ub la## an add new data member# to tho#e inherited form the parent la##. A# far a# method# are on erned0 the #ub la## an reu#e the inherited method# a# it i#0 hange them0 and it# own new method#. J&?&B) eC 52537 %e&24#e) &#e> Ea#e in ode orre tion. $arbage olle tion. Ab#en e of pointer#. Ja1a i# e7ten#ible. %:

Ja1a i# #e ure. Ja1a i# robu#t. Ja1a i# multithreading. Simpli ity.

L5;#&#D CE&))e)> The Ja1a platform in lude# an e7ten#i1e la## library #o that programmer# an u#e already e7i#ting la##e#0 a# it i#0 reate #ub la##e# to modify e7i#ting la##e# or implement interfa e# and augment the apabilitie# of la##e#. Cla##e# ontain data member# i.e. field# and fun tion# i.e. method#. In la##e# field# may be either 1ariable or on#tant0 and method# are fully implemented. I32e#%& e)> Interfa e# i# al#o merely li-e la##. Interfa e# al#o ontain data member# and fun tion#. ;ut the main differen e i# that in an interfa e0 field# mu#t be on#tant#0 and method# are ju#t prototype# with no implementation#. The prototype gi1e the method #ignature 8the return type0 the fun tion name and the number of parameter# with the type for ea h parameter90 but the programmer mu#t #upply implementation. To u#e an interfa e0 a programmer define# a la##0 de lare# that implement# the interfa e#0 and then implement# all the method# in that interfa e a# the la##. The method# are implemented in a way that i# appropriate for the la## in whi h the method# are being u#ed. Interfa e let one add fun tionality to a la## and gi1e a great deal of fle7ibility in doing it. In other word# interfa e# pro1ide mo#t of the ad1antage# of multiple inheritan e# without it# di#ad1antage#. "& <&7e)> A pa -age i# a olle tion of related ja1a la##e# and interfa e#. The following li#t0 gi1e# e7ample# of #ome ja1a pa -age# and what they o1er. %@

JAIA.IO> Cla##e# tho#e manage reading data from input #tream# and writing data to the output #tream#. JAIA.A=T> Cla##e# that manage u#er interfa e omponent# #u h a# window#0 dialog bo7e#0 button#0 he - bo7e#0 li#t#0 menu#0 # rollbar#0 and te7t field#( the KA=T< #tand# Ab#tra t =indow Tool-it. JAIA.APP!ET> The applet la##0 whi h pro1ide# the ability to write applet#0 thi# pa -age al#o in lude# #e1eral interfa e# that onne t an applet to it# do ument and to re#our e# for playing audio. JAIA.A=T.EIE+T> $"I# are e1ent dri1en( it mean# they generate e1ent# when the u#er of the program intera t# with the $"I. JAIAL.S=I+$> Thi# pa -age enable# the u#er to reate interfa e# whi h perform# the $"I operation#. JAIA.SM!> The J,;C API0 la##e# and interfa e# that a e## databa#e and #end SM!. In Ja1a0 pa -age# #er1e a# ba#i# for building other pa -age. T!e J&?& "E&2%$#( B45E6) 53 Se 4#52D 53 .$4# :&D)> The way memory i# allo ated and laid out2 In ja1a an obje t# lo ation in memory i# not determined until the runtime0 a# oppo#ed to C and CJJ0 where the ompiler ma-e# memory layout de i#ion#. A# the re#ult0 a programmer annot loo- at a la## definition and figure# out how it might be laid laid out in memory. Al#o #in e0 ja1a ha# no pointer#0 a programmer annot forge pointer to memory. The way in oming ode i# he -ed. The ja1a 1irtual ma hine doe#n<t tru#t any in oming ode and #ubje t# it to what i# alled ;yte Code 1erifi ation. The byte ode 1erifier0 part of the 1irtual ma hine0 he -# that The format of in oming ode i# orre t In oming ode doe#n<t forge pointer# It doe#n<t 1iolate a e## re#tri tion# It a e## obje t# a# what they are

The way la##e# are loaded. The ja1a byte ode loader0 another Part of the 1irtual %F

ma hine0 he -# whether la##e# loaded during program e7e ution are lo al or from a ro## a networ-. Imported la##e# annot be #ub#tituted for built in la##e# annot a identally referen e la##e# brought in o1er a networ-. The way a e## i# re#tri ted for entru#ted ode. The ja1a #e urity manager allow# u#er to re#tri t entru#ted ja1a applet# #o that they annot a e## the lo al networ-0 lo al file# and other re#our e#. :!&2 5) JDBCF J,;C i# a ja1a TM API for e7e uting SM! #tatement#. It on#i#t# of a #et of la##e# and interfa e# written in the ja1a programming language that ma-e# it ea#y to #end SM! #tatement# to 1irtually any relational databa#e#. J,;C 8Ja1a ,ataba#e Conne ti1ity9 i# a front end tool for onne ting #er1er to O,;C in that re#pe t. J,;C i# e##entially a low>le1el appli ation programming interfa e. It i# alled a# low>le1el API #in e any data manipulation0 #torage and retrie1al ha# to be done by the program it#elf. Some tool# whi h pro1ide a higher>le1el ab#tra tion of0 e7pe ted #hortly. The ombination of ja1a and J,;C let# a programmer write it on e and run it anywhere. ReG45#e(e32) 2$ 4)e JDBC> To u#e J,;C we need a ba#i -nowledge of databa#e and SM!. =e need the jd-%.% 8Ja1a ,e1elopment Nit %.% a1ailable Ja1a Soft<# web#ite9 or a 1er#ion of ja1a #in e jd-%.% and abo1e ome bundled with J,;C #oftware. A ba ->end databa#e engine for whi h a J,;C dri1er i# a1ailable. =hen J,;C dri1er# area not a1ailable J,;C>O,;C bridge dri1er# are u#ed to a e## the databa#e through O,;C. ;a ->end i# not needed when J,;C dri1er i# apable of #toring and retrie1ing the %E

data it#elf0 or if J,;C>O,;C bridge and the O,;C dri1er an be u#ed to #tore and retrie1e the information.

:!&2 6$e) JDBC 6$F J,;C ma-e# it po##ible to do three thing#. E#tabli#he# the onne tion to databa#e Send SM! #tatement# Pro e## the re#ult#.

J,;C i# a low>le1el API and a ba#e for /igher>le1el API. J,;C i# a low>le1el interfa e0 whi h mean# that it i# u#ed to in1o-e SM! ommand# dire tly. It wor-# 1ery well in thi# apa ity and i# ea#ier to u#e than other to build higher>le1el interfa e# and tool#. A higher le1el interfa e #u h a# J,;C. There are two -ind# of higher>le1el API#. An embedded SM! for ja1a and A dire t mapping of relational databa#e table# to ja1a la##e#.

J&?&B) M&757> T!e BD2e C$6e The -ey that allow# ja1a to #ol1e both the #e urity and the portability problem# ju#t de# ribed i# that the output of a ja1a ompiler i# not e7e utable ode. Rather0 it i# ;yte ode. ;yte ode i# highly optimiHed #et of in#tru tion# de#igned to be e7e uted by the ja1a run>time #y#tem0 whi h i# alled the Ja1a Iirtual Ma hine 8JIM9. That i#0 in it# #tandard form0 the JIM i# an interpreter for ;yte ode. Thi# may ome a# a bit of a #urpri#e. Tran#lating a ja1a program into ;yte ode help# ma-e# ea#ier to run a program in a wide 1ariety of en1ironment#. The rea#on i# #traight forward( only the JIM need# to be implemented for ea h platform. On e the run>time pa -age e7i#t# for a gi1en #y#tem0 any ja1a program an run on it. Remember0 although the detail# of the JIM will differ from %A

platform to platform0 all interrupt the #ame Ja1a ;yte Code.

JDBC D#5?e#)> The J,;C API found# in ja1a.#*l pa -age0 on#i#t# only a few on rete la##e#. Mu h of the API i# di#tributed a# databa#e>neutral interfa e la##e# that #pe ify beha1ior without pro1iding any implementation. The a tual implementation# are pro1ided by third>party 1endor#. An indi1idual databa#e #y#tem i# a e##ed 1ia a #pe ifi J,;C dri1er that implement# the ja1a.#*l.,ri1er interfa e. ,ri1er# e7i#t for nearly all popular R,;MS #y#tem#0 though few are a1ailable for free. Sun bundle# a free J,;C>O,;C bridge dri1er with the J,N to allow a e## to #tandard O,;C data #our e#0 #u h a# a Mi ro#oft A e## ,ataba#e. /owe1er0 Sun ad1i#e# again#t u#ing the bridge dri1er for anything other than de1elopment and 1ery limited deployment. Ser1let de1eloper# in parti ular #hould need thi# warning be au#e any problem in the J,;C>O,;C bridge dri1er<# nati1e ode #e tion an ra#h the entire #er1er0 not ju#t your #er1let#. J,;C dri1er# are a1ailable for mo#t databa#e platform#0 from a number of 1endor# and in a number of different fla1or#. There are four dri1er ategorie#2 TD1e1/JDBC/ODBC B#567e D#5?e# Type% dri1er# u#e a bridge te hnology to onne t a ja1a lient to an O,;C databa#e #er1i e. Sun<# J,;C>O,;C bridge i# the mo#t ommon Type% dri1er. The#e dri1er# are implemented u#ing nati1e ode. TD1e2/ N&25?e/A"I "&#2ED/J&?& D#5?e# Type3 dri1er# wrap thi# layer of ja1a around databa#e>#pe ifi nati1e ode

librarie#. ?or Ora le databa#e#0 the nati1e librarie# might be ba#ed on OCI 8Ora le Call %B

Interfa e9 librarie#0 whi h were originally de#igned for C4CJJ programmer#. ;e au#e Type3 dri1er# are implementing u#ing nati1e ode0 in #ome a#e# they ha1e better performan e than their all>Ja1a ounterpart#. They add an element of ri#-( howe1er0 be au#e a defe t in a dri1er<# nati1e ode #e tion an ra#h the entire #er1er. TD1e3/ Ne2/"#$2$ $E AEE/J&?& D#5?e# Type: dri1er# ommuni ate 1ia a generi networ- proto ol to a pie e of u#tom middleware. The middleware omponent# might u#e any type of dri1er to pro1ide the a tual databa#e a e##. =eb!ogi <# Tengah produ t line i# an e7ample. The#e dri1er# are all ja1a0 whi h ma-e# them u#eful for applet deployment and #afe for #er1let deployment. TD1e4/ N&25?e/"#$2$ $E AEE/J&?& D#5?e# Type@ di1er# are the mo#t dire t of the lot. =ritten entirely in ja1a0 Type@ dri1er# under#tand databa#e>#pe ifi networ-ing proto ol# and an a e## the databa#e dire tly without any additional #oftware. A li#t of urrently a1ailable J,;C dri1er# an be found at -e22537 & C$33e 25$3 The fir#t #tep in u#ing a J,;C dri1er to get a databa#e onne tion in1ol1e# loading the #pe ifi dri1er la## into the appli ation<# JIM. Thi# ma-e# the dri1er a1ailable later0 when we need i# for opening the onne tion. An ea#y way to load the dri1er la## i# to u#e the Cla##.for+ame 89 method2 CE&)).%$#N&(e 8H)43.'6; .$6; IJ6; O6; D#5?e#J9> =hen the dri1er i# loaded to memory0 it regi#ter# it#elf with the ja1a.#*l.,ri1erManager la## to open a onne tion to a gi1en databa#e0 where the %C

databa#e i# #pe ified by a #pe ially formatted "R!. The method u#ed to open the onne tion i# ,ri1erManager.$etConne tion 89. It return# a la## that implement# the ja1a.#*l.Conne tion interfa e2 A J,;C "R! identifie# an indi1idual databa#e in a dri1er>#pe ifi manner. ,ifferent dri1er# may need different information in the "R! to #pe ify the ho#t databa#e. J,;C "R!# u#ually begin with jdb 2#ub proto ol2#ubname during the all to get Conne tion890 the ,ri1er Manager obje t a#-# ea h regi#tered dri1er if it re ogniHe# the "R!. If a dri1er #ay# ye#0 the dri1er manager u#e# that dri1er to reate the onne tion obje t. /ere i# a #nippet of ode a #er1let might u#e to load it# databa#e dri1er with the J,;C>O,;C ;ridge and reate an initial onne tion2

SERVLETS>
:!&2 &#e J&?& )e#?Ee2)F Ser1let# are Ja1a te hnology<# an#wer to C$I programming. They are program# that run on a =eb #er1er and build =eb page#. ;uilding =eb page# on the fly i# u#eful 8and ommonly done9 for a number of rea#on#2 T!e :e; 1&7e 5) ;&)e6 $3 6&2& )4;(522e6 ;D 2!e 4)e#. ?or e7ample the re#ult# page# from #ear h engine# are generated thi# way0 and program# that pro e## order# for E> om#itedo thi# a# well. T!e 6&2& !&37e) %#eG4e32ED.

?or e7ample0 a weather>report or new# headline# page might build the page dynami ally0 perhap# returning a pre1iou#ly built page if it i# #till up to date. T!e :e; 1&7e) 4)e) 53%$#(&25$3 %#$( 3D $#1$#&2e 6&2&;&)e)

$# $2!e# )4 ! )$4# e). ?or e7ample0 you would u#e thi# for ma-ing a web page at On>line #tore# that li#t# urrent pri e# and number of item# in #to -. :!&2 &#e 2!e A6?&32&7e) $% Se#?Ee2) O?e# HT#&6525$3&EJ C-IF Ja1a #er1let# are more effi ient0 ea#ier to u#e0 more powerful0 more portable0 and heaper than traditional C$I and than many alternati1e C$I>li-e te hnologie#. E%%5 5e32>

=ith traditional C$I0 a new pro e## i# #tarted for ea h /TTP re*ue#t. If the C$I pro e## doe# a relati1ely fa#t operation0 the o1erhead of #tarting the pro e## an dominate the e7e ution time. =ith #er1let#0 the Ja1a Iirtual Ma hine #tay# up0 and ea h re*ue#t i# handled by a lightweight Ja1a Thread0 not a hea1yweight operating #y#tem pro e##. Similarly0 in traditional C$I0 if there are + #imultaneou# re*ue#t to the #ame C$I program0 then the ode for the C$I program i# loaded into memory n time#. =ith #er1let#0 howe1er0 there are + thread# but only a #ingle opy of the #er1let la##. Ser1let# al#o ha1e more alternati1e# than do regular C$I program# for optimiHation# #u h a# a hing pre1iou# omputation#0 -eeping databa#e onne tion# open0 and the li-e. C$3?e35e32>

/ey0 you are already -nown Ja1a. =hy learn Perl tooO ;e#ide# the on1enien e of being able to u#e a familiar language0 #er1let# ha1e an e7ten#ion infra#tru ture for automati ally par#ing and de oding /TM! form data0 reading and #etting /TTP header#0 handling oo-ie#0 tra -ing #e##ion#0 and many other #u h utilitie#. "$@e#%4E> 3%

Ja1a #er1let# let you ea#ily do #e1eral thing# that are diffi ult or impo##ible with regular C$I. ?or one thing0 #er1let# an tal- dire tly to the =eb #er1er 8regular C$I program# an<t9. Thi# #implifie# operation# that need to loo- up image# and other data #tored in #tandard pla e#. Ser1let# an al#o #hare data among ea h other0 ma-ing u#eful thing li-e databa#e onne tion pool# ea#y to implement. They an al#o maintain information from re*ue#t to re*ue#t0 #implifying thing# li-e #e##ion tra -ing and a hing of pre1iou# omputation#. "$#2&;Ee>

Ser1let# are written in ja1a and follow# a well>#tandardiHed API. Con#e*uently0 #er1let# return for0 I>Planet Enterpri#e Ser1er an run 1irtually un hanged on Apa he0 Mi ro#oft IIS0 or =eb Star. Ser1let# are #upported dire tly or 1ia plug>in on almo#t e1ery major =eb Ser1er. I3eC1e3)5?e>

There are a number of free or 1ery ine7pen#i1e =eb #er1er# a1ailable that are good for &per#onal' u#e or low>le1el =eb #ite#. /owe1er0 with the major e7 eption of Apa he0 whi h i# free0 mo#t ommer ial>*uality =eb #er1er# are relati1ely e7pen#i1e. +e1erthele##0 on e you ha1e a =eb #er1er0 no matter the o#t #er1er0 adding #er1let #upport to it 8if it doe#n<t ome pre onfigured to #upport #er1let#9 i# generally free or heap. :!&2 5) JS"F Ja1a Ser1e Page# 8JSP9 i# a te hnology that let# you mi7 regular0 #tati /TM! with dynami ally>generated /TM!. Many =eb page# that are built by C$I program# are mo#tly #tati 0 with the dynami part limited to a few #mall lo ation#. ;ut mo#t C$I 1ariation#0 in luding #er1let#0 ma-e you generate the entire page 1ia your program0 e1en 33

though mo#t of it i# alway# the #ame. JSP let# you reate the two part# #eparately. /ere<# an e7ample2 :!&2 &#e 2!e A6?&32&7e) $% JS"F V). A 25?e Se#?e# "&7e) 8AS"9>

ASP i# a #imilar te hnology from Mi ro#oft. The ad1antage# of JSP are twofold. ?ir#t0 the dynami part i# written in Ja1a not in Ii#ual ;a#i or other MS>#pe ifi language. So it i# more powerful and ea#ier to u#e. Se ond0 it portable to other operating #y#tem# and non>Mi ro#oft web #er1er#. V). "4#e Se#?Ee2)>

JSP doe#n<t gi1e you anything that you ouldn<t in prin iple do with a #er1let. ;ut it i# more on1enient to write 8and to modifyP9 regular /TM! than to ha1e a Hillion println #tatement# that generate the /TM!. Plu#0 by #eparating the loo- from the ontent you an put different people on different ta#-#2 your =eb page de#ign e7pert# an build the /TM!0 lea1ing pla e# for your #er1let programmer# to in#ert the dynami V). Se#?e#/S56e I3 E46e) 8SSI9> ontent.

SSI i# a widely>#upported te hnology for in luding e7ternally>defined pie e# into a #tati =eb page. JSP i# better be au#e it let# you u#e #er1let# in#tead of a #eparate program to generate that dynami part. ;e#ide#0 SSI i# really only intended for #imple in lu#ion#0 not for &real' program# that u#e form data0 ma-e databa#e onne tion#0 and the li-e. V). J&?&S #512> an generate /TM! dynami ally on the 3: lient. Thi# i# a u#eful

Ja1aS ript

apability0 but only handle# #ituation# where the dynami information i# ba#ed on the lient<# en1ironment. =ith the e7 eption of oo-ie#0 /TTP and form #ubmi##ion data i# not a1ailable to Ja1aS ript. And0 #in e it run# on the lient0 Ja1aS ript an<t a e## #er1er>#ide re#our e# li-e databa#e#0 atalog#0 pri ing information0 and the li-e. V). S2&25 HTML>

Regular0 /TM!0 of our#e0 annot ontain dynami information. JSP i# #o ea#y and on1enient that it i# *uite fea#ible to argument /TM! page# that only benefit marginally by the in#ertion of #mall amount# of dynami data. Pre1iou#ly0 the o#t of u#ing dynami data would pre lude it# u#e in all but the mo#t 1aluable in#tan e#. B&)5 Se#?Ee2 S2#4 24#e> /ere<# the outline of a ba#i #er1let that handle# $ET re*ue#t#. $ET re*ue#t#0 for tho#e unfamiliar with /TTP0 are re*ue#t# made by brow#er# when the type# in a "R! on the addre## line0 follow# a lin- from a web page0 or ma-e# an /TM! form that doe# not #pe ify a MET/O,. Ser1let# an al#o 1ery ea#ily handle POST re*ue#t#0 whi h are generated when #omeone reate# an /TM! form that #pe ifie# MET/O,Q'POST'. Import ja1a.io.R( Import ja1a7.#er1let.R( Import ja1a7.#er1let.http.R( Publi la## SomeSer1let# e7tend# /ttpSer1let S

Publi 1oid do$et8/ttpSer1letRe*ue#t re*ue#t0 /ttpSer1letRe#pon#e re#pon#e9 throw# Ser1letE7 eption.IOE7 eption S 44"#e &re*ue#t' to read in oming /TTP header# 8e.g. oo-ie#9 44and /TM! form data 8e.g. data the u#er entered and #ubmitted9

3@

44"#e &re#pon#e' to #pe ify the /TTP re#pon#e line and header# 44 8e.g. #pe ifying the ontent type0 #etting oo-ie#9. print=riter outQre#pon#e.get=riter 89( 44"#e &out' to #end ontent to brow#er T To be a #er1let0 a la## #hould e7tend /ttpSer1let and o1erride do$et or doPo#t 8or both90 depending on whether the data i# being #ent by $ET or by POST. The#e method# ta-e two argument#2 an httpSer1letRe*ue#t and an /ttpSer1letRe#pon#e. The /ttpSer1letRe*ue#t ha# method# that let you find out about in oming information #u h a# ?ORM data0 /TTP re*ue#t header#0 and the li-e. The /ttpSer1letRe#pon#e ha# method# that let# you #pe ify the /TTP re#pon#e line 83DD0@D@0 et .90 re#pon#e header# 8Content> Type0 Set>Coo-ie#0 et .90 and0 mo#t importantly0 let# you obtain a Print=riter u#ed to #end output ba - to the lient. ?or #imple #er1let#0 mo#t of the effort i# println #tatement# that generate the de#ired page. +ote that do$et and doPo#t throw two e7 eption#0 #o you are re*uired to in lude them in the de laration. Al#o note that you ha1e to import la##e# in ja1a.io 8for print=riter0 et .90 ja1a7.#er1let 8for /ttpSer1let0 et .90 and ja1a7.#er1let.http 8for /ttpSer1letRe*ue#t and /ttpSer1letRe#pon#e9. ?inally0 note that do$et and doPo#t are alled by the #er1i e method0 and #ometime# you may want to o1erride #er1i e dire tly0 e.g. for a #er1let that handle# both $ET and POST re*ue#t. C$(15E537 &36 I3)2&EE537 2!e Se#?Ee2> +ote that the #pe ifi detail# for in#talling #er1let# 1ary from web #er1er to web #er1er. Plea#e refer to your web #er1er do umentation for definiti1e dire tion#. The on> line e7ample# are running on Ja1a =eb Ser1er 8J=S9 3.D0 where #er1let# are e7pe ted to be in a dire tory alled Ser1let# in the J=S in#tallation hierar hy. /owe1er0 I pla ed thi# #er1let in a #eparate pa -age 8hall9 to a1oid onfli t# with other #er1let# on thi# #er1er. )ou will want to be the #ame if you are u#ing a web #er1er that i# u#ed by other people 3F

and doe#n<t ha1e a good infra#tru ture for &1irtual #er1er#' to pre1ent the#e onfli t# automati ally. If you<1e ne1er u#ed pa -age# before0 there are two way# to ompile la##e# that are in pa -age#. One way i# to #et your C!ASSPAT/ to point to the dire tory abo1e the a tually ontaining your #er1let#. )ou an them ompile normally from within the dire tory. ?or e7ample0 if your ba#e dire tory i# C2UJa1a=ebSer1erU#er1let# and your pa -age name 8and thu# #ubdire tory name9 i# hall0 and were on window#0 you<d do2 ,OS6 #et C!ASSPAT/QC2 UJa1a=ebSer1let#( VC!ASSPAT/V ,OS6 d C2UJa1a=ebSer1erU#er1let#Uhall ,OS6 ja1a yourSer1let.ja1a The fir#t path0 #etting the C!ASSPAT/0 you probably want to do permanently0 rather than ea h time you #tart a new ,OS window. On =indow# CF4CB you<d typi ally put the &#et C!ASSPAT/QWW.' Statement in your autoe7e .bat file #omewhere after the line that #et the C!ASSPAT/ to point to #er1let.har and j#p.jar. On =indow# +T0 you<d go to the Start menu0 #ele t #etting#0 #ele t Control panel0 #ele t #y#tem0 #ele t En1ironment0 then enter the 1ariable and 1alue. +ote al#o that if your pa -age were of the form name%.name3.name: rather than #imply name% a# here0 you<d #till ha1e the C!ASSPAT/ point to the top le1el dire tory of your pa -age hierar hy 8the one ontain name%9. A Se ond way to ompile la##e# that are in pa -age# i# to go to the dire tory abo1e the one ontaining your #er1let#0 and then do &ja1a dire toryU)ourSer1let.ja1a' 8"+IL( note the forward #la#h9. ?or e7ample0 #uppo#e again that your ba#e dire tory i# C2UJa1a=ebSer1erUSer1let# and your pa -age name 8and thu# #ubdire tory name9 i# hall0 and you were on =indow#. In that a#e0 you<d do the following2 ,OS6 d C2UJa1a=eb Ser1erUSer1let# ,OS6 ja1a hallU)our#er1let.ja1a

3E

+ote that0 on =indow#0 mo#t J,N %.% 1er#ion# of ja1a re*uire a ba -#la#h0 not a forward #la#h0 after the dire tory name. Thi# i# fi7ed in J,N %.%0 many #er1let author# #ti - with J,N %.%.for portability. ?inally0 another ad1an ed option i# to -eep the #our e ode in a lo ation di#tin t from the . la## file#0 and u#e ja1a <# &>d' option to in#tall them in the lo ation the web #er1er e7pe t#. R433537 2!e Se#?Ee2> =ith the Ja1a web Se1er0 #er1let# are pla ed in the #er1let# dire tory within the main J=S in#tallation dire tory0 and are in1o-ed 1ia http244ho#t4#er1let4Ser1let+ame. +ote that the dire tory i# #er1let#0 plural0 while the "R! refer# to #er1let0 #ingular. Sin e thi# e7ample wa# pla ed in the hall pa -age0 it would be in1o-ed 1ia http244ho#t4#er1let4hall./elloworld. Other =eb #er1er# may ha1e #lightly different on1ention# on where to in#tall #er1let# and how to in1o-e them. Mo#t #er1er# al#o let you define alia#e# for #er1let#. So that a #er1let an be in1o-ed 1ia http244ho#t4any> path4any>file.html. The pro e## for doing thi# i# ompletely #er1er #pe ifi 2 he - your #er1erX# do umentation for detail#. A Ser1let that generate# /TM! Mo#t #er1let# generate /TM!0 not plain te7t a# in the pre1iou# e7ample. To do that0 you need two additional #tep#2 tell the brow#er that you are #ending ba - /TM!0 and modify the println #tatement# to build a legal =eb page. The fir#t #tep i# done by #etting the Content>Type re#pon#e header. In general0 header# an be #et 1ia the #et/eader method of /ttpSer1letRe#pon#e0 but #etting the ontent type i# #u h a ommon ta#- that there i# al#o a #pe ial Set ontenttype method ju#t for thi# purpo#e. +ote that you need to #et re#pon#e header# before a tually returning any of the ontent 1ia the Printwriter. /ereX# an e7ample2 M&532e3&3 e ReEe&)e $% 2!e J&?& Se#?Ee2 2.0 S1e 5%5 &25$3> ,ownload the maintenan e relea#e of the Ja1a Ser1let Spe ifi ation0 1er#ion 3.F. Thi# 1er#ion of Ja1a Ser1let te hnology. 3A

I) 53 E46e6 53 2!e EE0 1E&2%$#(> :e; T5e# 2$ 7$ @52! J&?& EE0> A !oo- at Re#our e Inje tion Read about the #upport for annotation# by Ja1a =eb tier te hnologie# and how they an #implify a e## to re#our e#0 en1ironment data0 and life> y le ontrol. .$#( "#$ e))537 Se#?Ee2> Thi# #e tion #how# how to Pro e## form data Manage per#i#tent data "#e init parameter#

The ne7t Ser1let that we are going to write pro1ide# a u#er interfa e to a mailing li#t through /TM! form#. A u#er #hould be able to enter an email addre## in a te7t field and pre## a button to #ub# ribe to the li#t or another button to un#ub# ribe. The Ser1let on#i#t# of two major part#2 ,ata management Client intera tion.

D&2& (&3&7e(e32> The data management i# rather #traight>forward for an e7perien ed Ja1a Programmer. =e u#e a ja1a.lang.Ie tor obje t whi h ontain# the email addre##e# a# String#. Sin e a Ser1let a ha# data whi h per#i#t# between re*ue#t# we load the addre## li#t only on e0 when the Ser1let i# initialiHed0 and #a1e it e1ery time it ha# been hanged by a re*ue#t. An alternati1e approa h would be -eeping the li#t in memory while the Ser1let i# a ti1e and writing it to di#- in the de#troy method. Thi# would a1oid the 3B

o1erhead of #a1ing the addre## li#t after e1ery hange but i# le## fail>#afe. If for #ome rea#on the addre## file anXt be written to di#- or the #er1er ra#he# and annot de#troy the Ser1let0 all hange# to the li#t will be lo#t e1en though the u#er# who #ubmitted the re*ue#t# to hange the li#t re ei1ed po#iti1e re#pon#e#. In init we fir#t all #uper.init8 onfig9 to lea1e the Ser1letConfig management to the #uper la## 8/ttpSer1let90then we get the name of the addre## file from an init parameter8whi h i# #et up in the =eb Ser1er onfiguration9. If the parameter i# not a1ailable the Ser1let throw# a ja1a7.#er1let."na1ailableE7 eption 8a #ub la## of ja1a7.#er1letE7 eption9 whi h indi ate# that a Ser1let i# temporarily 8if a duration i# #pe ified9 or permanently 8a# in thi# a#e9 una1ailable. ?inally0 the init method de#teriliHe# the addre## file or reate# an empty Ie tor if the addre## file doe# not e7i#t yet. All e7 eption# that o ur during the re#erialiHation are tran#formed into "na1ailable E7 eption#. The method# #ub# ribe and un#ub# ribe are u#ed to 8un>9#ub# ribe an addre##. They #a1e the addre## li#t if it wa# modified by alling #a1e 89 and return a ;oolean #u e## 1alue. +ote that the#e method# are both #yn hroniHed 8on the Ser1let obje t9to en#ure the integrity of the addre## li#t0 both0 in memory and on di#-. The #a1e method #erialiHe# the addre## li#t to the addre## file on di#- whi h an be read again by init when the Ser1let i# re#tarted. CE5e32 532e#& 25$3> The lient intera tion i# handled by two of the #tandard /ttpSer1let method#0 do$et and doPo#t. The do$et method replie# to $ET re*ue#t# by #ending an /TM! page whi h ontain# the li#t of the urrently #ub# ribe or un#ub# ribe an addre##2 The re#pon#e ontent type i# again #et to te7t4html and the re#pon#e i# mar-ed a# not a heable to pro7y #er1er# and lient# 8be au#e it i# dynami ally reated9 by #etting an /TTP header &pragma2no> a he'. The form a#-# the lient to u#e the POST method for #ubmitting form data. /ere i# a typi al output by thi# method2 The doPo#t method re ei1e# the #ubmitted form data0 update# the addre## li#t and 3C

#end# ba - a onfirmation page2 ?inally a onfirmation page i# #ent with the u#ual method. Re*.getRe*ue#t"RI 89 i# u#ed to get the "RI of the Ser1let for a lin- ba - to the main page 8whi h i# reated by do$et9. A# u#ual0 the Ser1let e7tend# ja1a7.http.#er1let./ttpSer1let and o1erride# getSer1letInfo to pro1ide a #hort noti e. At la#t0 here i# the full #our e ode of the !i#tManagerSer1let.

3.2 BACK END 8ORACLE9


ECe 42537 SKL K4e#5e)> To really u#e a databa#e0 we need to ha1e #ome way to e7e ute *uerie#. The #imple#t way to e7e ute a *uery i# to u#e the ja1a.#*l.Statement la##. Statement obje t# are ne1er in#tantiated dire tly( in#tead0 a program all# the reateStatement89 method of Conne tion to obtain a new Statement obje t2 Statement #tmtQ on. rea2Statement89( A *uery that return# data an be e7e uted u#ing the e7e uteMuery 89 method of Statement and return# a ja1a.#*l.Re#ultSet that en ap#ulate# the retrie1ed data2 Re#ultSet r#>#tmt.e7e uteMuery8&SE!ECT R ?ROM C"STOMERS'9( )ou an thin- of a Re#ultSet obje t a# a repre#entation of the *uery re#ult returned one row at a time. )ou u#e the ne7t89 method of Re#ultSet to mo1e from row to row. The Re#ultSet interfa e al#o boa#t# a multitude of method# de#igned for retrie1ing data from the urrent row. The getString 89 and getObje t 89method# are among the mo#t fre*uently u#ed for retrie1ing olumn 1alue#2 while8r#.ne7t899 S :D

String e1entQr#.getString8&e1en'9( Obje t ountQ8Integer9r#.getObje t8& ount'9( T )ou #hould -now that the Re#ultSet i# lin-ed to it# parent Statement. Therefore0 if a Statement i# lo#ed or u#ed to e7e ute another *uery0 any related Re#ultSet obje t# are lo#ed automati ally. H&36E537 SKL EC e125$3)> ,;Phone!oo-up en lo#e# mo#t of it# ode in a try4 at h blo -. Thi# blo at he# two e7 eption#2 Cla##+ot?oundE7 eption and SM!E7 eption. The former i# thrown by the Cla##.for+ame89 method when the J,;C dri1er la## an not be loaded. The latter i# thrown by any J,;C method that ha# a problem. SM!E7 eption obje t# are ju#t li-e any other e7 eption type0 with the additional feature that they an hain. The SM!E7 eption la## define# an e7tra method0 get+e7tE7 eption890 that allow# the e7 eption to en ap#ulate additional E7 eption obje t#. =e didn<t bother with thi# feature in the pre1iou# e7ample0 but here<# how to u#e it2 Cat h8SM!E7 eption e9 S out.println8e.getMe##age899( while88eQe.get+e7tE7 eption899PQnull9 S out.println8e.getMe##age899( T T Thi# ode di#play# the me##age from the fir#t e7 eption and then loop# through all the remaining e7 eption#0 outputting the error me##age a##o iated with ea h one. In pra ti e0 the fir#t e7 eption will generally in lude the mo#t rele1ant information. Re)4E2) 53 De2&5E> :%

;efore we ontinue0 we #hould ta-e a lo#er loo- at the Re#ultSet interfa e and related Re#ultSetMeta,ata interfa e. In E7ampleC>%0 we -new what our *uery loo-ed li-e0 and we -new what we e7pe ted to get ba -0 #o we formatted the output appropriately. ;ut0 if we want to di#play the re#ult# of a *uery in an /TM! table0 it would ni e to ha1e #ome Ja1a ode that build# the table automati ally from the Re#ultSet rather than ha1ing to write the #ame loop>and>di#play ode o1er and o1er. A# an added bonu#0 thi# -ind of ode ma-e# it po##ible to hange the ontent# of the table #imply by hanging the *uery. The Re#ultSetMeta,ata interfa e pro1ide# a way for a program to learn about the underlying #tru ture of a *uery re#ult on the fly. =e an u#e it to build an obje t that dynami ally generate# an /TM! table from a Re#ultSet0 a# #hown in E7ampleC>3. Many Ja1a /TM! generation tool# ha1e a #imilar apability. H&36E537 N4EE .5eE6)> /andling null databa#e 1alue# with J,;C an be a little tri -y8 A databa#e field an be #et to null to indi ate that no 1alue i# pre#ent0 in mu h the #ame way that a Ja1a obje t an be #et to null9. A method that doe# not return an obje t0 li-e getInt890ha# no way of indi ating whether a olumn i# null or whether it ontain# a tual information. 8Some dri1er# return a #tring that ontain# the te7t &null' when getString89 i# alled on a null olumnP9 any #pe ial 1alue li-e >%0 might be a legitimate 1alue. Therefore0 J,;C in lude# the wa#+ull89 method in Re#ultSet0 whi h return# true or fal#e depending on whether the la#t olumn read wa# a true databa#e null. Thi# mean# that you mu#t read data from the Re#ultSet into a 1ariable0 all wa# +ull 890 and pro eed a ordingly. It<# not pretty0 but it wor-#. /ere<# an e7ample2 int ageQr#.getInt8&age'9( if8Pr#.wa#+ull899 out.println8&Age2'Jage9(

:3

Another way to he - for null 1alue# i# to u#e the getObje t89 method. If a olumn i# null0 getObje t89 alway# return# null. Compare thi# to the getString89 method that ha# been -nown0 in #ome implementation#0 to return the empty #tring if a olumn i# null. "#ing getObje t89 eliminate# the need to all wa#+ull89 and lead# to #impler ode. U16&2537 2!e D&2&;&)e> Mo#t databa#e>enabled web #ite# need to do more than ju#t perform duerie#. =hen a lient #ubmit# an order or pro1ide# #ome -ind of information0 the data need# to be entered into the databa#e. =hen you -now you<re e7e uting a SM! "P,ATE0 I+SERT0 or ,E!ETE #tatement and you -now you don<t e7 ept a Re#ultSet0 you an u#e the e7e ute"pdate89 method of #tatement. It return# a ount that indi ate# the number of row# modified by the #tatement. It<# u#ed li-e thi#2 int ountQ #tmt.e7e ute"pdate8&,E!ETE ?ROM C"STOMERS =/ERE

C"STOMERYI,QF'9 If you are e7e uting SM!0 that may return either a Re#ultSet or a ount 8#ay0 if you<re handling u#er>#ubmitted SM! or building generi data>handling la##e#90 u#e the generi e7e ute89 method of #tatement. It return# a ;oolean who#e 1alue i# true if the SM! #tatement produ ed one or more Re#ultSet obje t# or fal#e if it re#ulted in an update ount2 boolean bQ#tmt.e7e ute8#*l9( The getRe#ultSet89 and get"pdateCount89 method of #tatement pro1ide a e## to the re#ult# of the e7e ute89 method. U)537 "#e1&#e6 S2&2e(e32)> A prepared #tatement obje t i# li-e a regular #tatement obje t0 in that it an be u#ed to e7e ute SM! #tatement#. The important differen e i# that the SM! in a PreparedStatement ::

i# pre ompiled by the databa#e for fa#ter e7e ution. On e a PreparedStatemant ha# been ompiled0 it o1er and o1er. "#e the preparedStatement 8String9 method of onne tion to reate preparedStatement obje t#. "#e theO Chara ter a# a pla eholder for 1alue# to be #ub#tituted later. ?or e7ample2 PreparedStatement p#tmt Q on.preparedStatement 8&I+SERT I+TO OR,ERS 8OR,ERYI,0 C"STOMERYI,.TOTA!9 IA!"ES 8O0O0O9'9( I+SERT I+TO M"SNETEERS 8+AME9 IA!"ES 8KJohn d<Artangan<9 A# you #ee0 the #tring terminate# twi e. One #olution i# to manually repla e the #ingle *uote< with two #ingle *uote#'0 the Ora le e# ape #e*uen e for one #ingle *uote. Thi# #olution0 re*uire# you to e# ape e1ery hara ter that your databa#e treat# a# #pe ialZnot an ea#y ta#- and not on#i#tent with writing platform>independent ode. A far better #olution i# to u#e a preparedStatement and pa## the #tring u#ing it# #etString89 method0 a# #hown below. The preparedStatement automati ally e# ape# the #tring a# ne e##ary for your databa#e2 PreparedStatement p#tmt Q on.preparedStatement 8&I+SERT I+TO M"SNETEERS 8+AME9 IA!"ES 8O9'9 ( P#tmt.#etString 8%0'John d<Artagan'9( P#tmt.e7e ute"pdate 89( 3.2 MODULES> There are F module# in thi# proje t. Admini#trator Module. Re#er1ation Agent Module. Pa##enger Module. Payment. Can ellation. an #till be u#tomiHed by adju#ting predefined parameter#. Prepared #tatement# are u#eful in appli ation# that ha1e to run the #ame general SM! ommand

:@

MODULES E="LANATION> Admini#trator Module. Enable# the admini#trator to perform all admini#trati1e fun tion# and manage in1entory o1er !A+ or the Internet. The admini#trator an define or modify route#0 fare# # hedule# and a##ign or deny a e## for *ualified tra1el agent# and other authoriHed u#er#. Re#er1ation Agent Module.

Allow# the airline# re#er1ation agent# to ma-e and modify re#er1ation on the !A+ or o1er the internet. The re#er1ation agent# ould be #tationed at any airline offi e lo ation. Pa##enger Module.

Thi# module enable# online u#tomer# to ma-e re#er1ation#0 1iew# their boo-ing#0 ma-e #pe ial #er1i e re*ue#t# and define their preferen e# o1er the web. Payment.

Pro1ide# the airline with the ability to #et up 1ariou# tra1el agent# and gi1e them re#er1ation# apabilitie# o1er the Internet. The tra1el agent# are able to di#play and offer di# ounted fare# to pa##enger#. Can ellation.

The #y#tem #hould allow the u#er to an el the e7i#ting boo-ing. In thi# an ellation 1ery helpful in all the tra1eler#.

:F

4. SYSTEM DESI-N>
4.1 UML DIA-RAMS> The "nified Modified !anguage pre# ribe# a #tandard #et of diagram# and notation# for modeling obje t oriented #y#tem#0 and de# ribe the underlying #emanti # of what the#e diagram# and #ymbol# mean. =herea# there ha# been to thi# point many notation# and method# u#ed for obje t>oriented de#ign0 now there i# a #ingle notation for modeler# to learn. "M! model #y#tem#2 U ) e C & ) e 6 5 & 7 # & ( for modeling the bu#ine## pro e##e# S e G 4 e 3 e 6 5 & 7 # & ( for modeling me##age pa##ing between an be u#ed to model different -ind# of #y#tem#2 #oftware #y#tem#0 hardware #y#tem#0 and real>world organiHation#. "M! offer# nine diagram# in whi h to

obje t# C $ E E & ; $ # & 2 5 $ 3 6 5 & 7 # & ( for modeling obje t intera tion# S 2 & 2 e 6 5 & 7 # & ( for modeling the beha1ior of obje t# in the

#y#tem A 2 5 ? 5 2 D 6 5 & 7 # & ( for modeling the beha1ior of "#e Ca#e#0 C E & ) ) 6 5 & 7 # & ( for modeling the #tati #tru ture of la##e# in

Obje t#0 or Operation# the #y#tem O ; ' e 2 6 5 & 7 # & ( for modeling the #tati #tru ture of obje t# in C $ ( 1 $ 3 e 3 2 6 5 & 7 # & ( for modeling omponent# :E

the #y#tem

D e 1 E $ D ( e 3 2 6 5 & 7 # & ( for modeling di#tribution of the

#y#tem. "M! i# a on#olidation of many of the mo#t u#ed obje t>oriented notation# and on ept#. It began a# a on#olidation of the wor- of $rady ;oo h0 Jame# Rumbaugh0 and I1ar Ja ob#on0 reator# of three of the mo#t popular obje t>oriented methodologie#. In %CCE0 the Obje t Management $roup8OM$90 a #tandard# body for the obje t> oriented ommunity0 i##ued a re*ue#t for propo#al for a #tandard obje t>oriented analy#i# notation and #emanti meta model. "M!0 1er#ion %.D0 wa# propo#ed a# an an#wer to thi# #ubmi##ion in January of %CCA. There were fi1e other ri1al #ubmi##ion#. ,uring the our#e of %CCA0 all #i7 #ubmitter# united their wor- and pre#ented to OM$ a re1i#ed "M! do ument0 alled "M! 1er#ion %.%. Thi# do ument wa# appro1ed by the OM$ in +o1ember %CCA. The OM$ all# thi# do ument OM$ "M! 1er#ion %.%. The OM$ i# urrently in the pro e## of performing a te hni al. 4.1.1 CLASS DIA-RAMS> The la## diagram i# the main #tati analy#i# and de#ign diagram for a #y#tem. In it0 the la## #tru ture of the #y#tem i# #pe ified0 with relation#hip# between la##e# and inheritan e #tru ture#. ,uring analy#i# of the #y#tem0 the diagram i# de1eloped with an eye for an ideal #olution. ,uring de#ign0 the #ame diagram i# u#ed0 and modified to onform to implementation detail#. 4.1.2. ACTIVITY DIA-RAMS> The A ti1ity ,iagram i# a multi>purpo#e pro e## flow diagram that i# u#ed to model beha1ior of the #y#tem. A ti1ity ,iagram an be u#ed to model a "#e Ca#e0 or a la##0 or a ompli ated method. An A ti1ity ,iagram an #how parallel pro e##ing. Thi# i# important when u#ing A ti1ity ,iagram to model bu#ine## pro e##e#0 #ome of whi h an be performed in parallel0 and for modeling multiple thread# in on urrent program#. 4.1.3 SEKUENCE DIA-RAM> :A

The Se*uen e diagram i# one of the mo#t effe ti1e diagram# to model obje t intera tion# in a #y#tem. A Se*uen e diagram i# modeled for e1ery "#e Ca#e. =herea# the "#e Ca#e diagram enable# modeling of a bu#ine## 1iew of the # enario0 the Se*uen e diagram ontain# implementation detail# of the # enario0 in luding the obje t# and la##e# that are u#ed to implement the # enario0 and me##age# pa##ed between the obje t#. 4.1.4 USE CASE DIA-RAM> "#e Ca#e modeling i# the #imple#t and mo#t effe ti1e te hni*ue for modeling #y#tem re*uirement# from a u#er<# per#pe ti1e. "#e Ca#e# are u#ed to model how a #y#tem or bu#ine## urrently wor-#0 or how the u#er# wi#h it to wor-. It i# not really an obje t>oriented approa h( it i# really a form of pro e## modeling. It i#0 howe1er0 an e7 ellent way to lead into obje t>oriented analy#i# of #y#tem#. "#e Ca#e# are generally the #tarting point of obje t>oriented analy#i# with "M!. The "#e Ca#e model on#i#t# of a tor# and "#e Ca#e#. A tor# repre#ent u#er# and other #y#tem# that intera t with the #y#tem. They are drawn a# #ti - figure#. They a tually repre#ent a type of u#er0 not an in#tan e of a u#er. "#e Ca#e# repre#ent the beha1ior of the #y#tem0 # enario that the #y#tem goe# through in re#pon#e to #timuli from an a tor. They are drawn a# Ellip#e#. Ea h "#e Ca#e i# do umented by a de# ription of the # enario. The de# ription an be written in te7tual form or in a #tep>by>#tep format. Ea h "#e Ca#e an al#o be defined by other propertie#0 #u h a# the pre> and po#t ondition# of the # enario [ ondition# that e7i#t before the # enario begin#0 and ondition# that e7i#t after the # enario omplete#. 4.1.0 COLLABORATION DIA-RAM> The Collaboration ,iagram pre#ent# an alternate to the Se*uen e ,iagram for modeling intera tion# between obje t# in the #y#tem. =herea# in the Se*uen e ,iagram the fo u# i# on the hronologi al #e*uen e of the # enario being modeled0 in the Collaboration ,iagram the fo u# i# on under#tanding all of the effe t# on a gi1en obje t :B

during a # enario. Obje t# are onne ted by lin-#0 ea h lin- repre#enting an in#tan e of an a##o iation between the re#pe ti1e la##e# in1ol1ed. The lin- #how# me##age# #ent between the obje t#0 the type of me##age pa##ed0 and the 1i#ibility of obje t# to ea h other. 4.1.6 DATA.LO: DIA-RAMS>

.574#e 1 CE&)) D5&7#&(

:C

.574#e 2 A 25?52D D5&7#&(

@D

.574#e 3 SeG4e3 e D5&7#&(

@%

.574#e 4 U)e C&)e D5&7#&()

.574#e 0 C$EE&;$#&25$3 D5&7#&(

@3

4.2 DATA DICTIONARY>


4.2.1 INTRODUCTION> D I C T I O N A R Y The logi al hara teri#ti # of urrent #y#tem data #tore#

in luding +ame0 Addre##0 ?light ode0 Sour e0 ,e#tination0 Airline ode0 ?light ode0 Credit ard number0 Payment amount et identifie# pro e## where the data are u#ed and where immediate a e## to information re*uired0 Ser1e# a# the ba#i# for identifying databa#e re*uirement# during #y#tem de#ign. U)e) $% D&2& D5 25$3&#D> To manage the detail# in large #y#tem#. To ommuni ate a ommon meaning for all #y#tem element#. To do ument the feature# of the #y#tem. To fa ilitie# analy#i# of the detail# in order to e1aluate determine where #y#tem hange# #hould be made. To lo ate error# and omi##ion# in the #y#tem. hara teri#ti # and

4.2.2 DATA DICTIONARY> 1. C&3 eEE&25$3. Thi# table i# u#ed to #tore the an el detail#. ?ield name an elid re#er1ationid an elationdate refundmoney ,e# ription Can ellation id Re#er1ation id ,ate of Can ellation Money to be refundable ,ata type int int date de imal SiHe %D %D %D0D Con#traint# PRIMAR) NE) ?OREI$+ NE) +OT +"!! +OT +"!!

@:

3. CE&))e) Thi# table i# u#ed to #tore the la## detail#. ?ield name Cla##id flight ode la## ode la##name ?are total la###eat ,e# ription Id of the la## > > +ame of the la## > Total #eat# in a la## 3. .E57!2 6&D) Thi# table i# u#ed to #tore the flight day<# detail# ?ield name date ode flight ode ,ate departure ,e# ription Code of the date flight departure Code of the flight date ,eparture time ,ata type int int date time SiHe %D %D on#traint# PRIMAR) NE) ?OREI$+ NE +OT +"!! +OT +"!! ,ata type int int 1ar har 1ar har de imal int SiHe %D %D FD FD %D0D %D on#traint# PRIMAR) NE) ?OREI$+ NE) +OT +"!! +OT +"!! +OT +"!! +OT +"!!

4. .E57!2 6e2&5E) Thi# table i# u#ed to #tore the flight detail#.

?ield name flight ode airline ode flightname #our e

,e# ription Code of the flight Code of the airline# +ame of the flight Starting pla e of the

,ata type int 1ar har 1ar har 1ar har @@

SiHe %D %DD %DD %DD

on#traint# PRIMAR) NE) +OT +"!! +OT +"!! +OT +"!!

de#tination total apa ity

flight ,e#tination of the flight Total apa ity of the flight 0. L$753

1ar har int

%DD %D

+OT +"!! +OT +"!!

Thi# table i# u#ed to #tore the login detail# ?ield name u#ername pa##word ,e# ription +ame of the u#er Pa##word for the u#er login 6. M&5E Thi# table i# u#ed to #tore the mail detail# ?ield name mailid Tou#er fromu#er Subje t me##age ,e# ription "#er# mail id ,e#tination of the mail ;y whom the mail i# #ent Subje t of the mail Me##age to be #ent ,ata type int 1ar har 1ar har 1ar har te7t SiHe %D 3FD 3FD 3FD on#traint# PRIMAR) NE) ?OREI$+ NE) ?OREI$+ NE) +OT +"!! +OT +"!! ,ata type 1ar har 1ar har SiHe FD FD on#traint# PRIMAR) NE) +OT +"!!

7. Ne@ U)e# Thi# table i# u#ed to #tore the new u#er detail#. ?ield name "#erid ?ir#tname la#tname ,e# ription "#er# id ?ir#t name of the u#er !a#t name of the u#er ,ata type int 1ar har 1ar har @F SiHe %D 3FD 3FD on#traint# PRIMAR) NE) +OT +"!! +OT +"!!

middlename mobileno ,ob addre## City State ountry emailid pa##word u#ertype u#ername

Middle name of the u#er Mobile number ,ate of birth > > > > Mail id > Type of the u#er +ame of the u#er 8. "&))e37e#

1ar har int date 1ar har 1ar har 1ar har 1ar har 1ar har 1ar har 1ar har 1ar har

3FD %D 3FD 3FD 3FD 3FD 3FD 3FD 3FD 3FD

+OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! "+IM"E NE)

Thi# table i# u#ed to #tore pa##enger detail#.

?ield name pa##engerno flight ode ,ob addre## nationality +ame $ender phoneno emailid pa##portno re#er1ationid

,e# ription +umber of the pa##enger# Code of the flight ,ate of birth > > +ame of the u#er > Phone number Mail id Pa##port number Re#er1ation id

,ata type Int Int ,ate 1ar har 1ar har 1ar har 1ar har 1ar har 1ar har Int Int

SiHe %D %D 3FD 3FD 3FD 3FD 3FD 3FD %D %D

on#traint# PRIMAR) NE) ?OREI$+ NE) +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!! ?OREI$+ NE)

9. "&D(e32 Thi# table i# u#ed to #tore payment detail#

@E

?ield name paymentid he -no redit ardno paidamount paymentdate pa##engerno

,e# ription > Che -ing number > > > >

,ata type Int Int Int de imal date Int

SiHe %D %D %D %D0D %D

on#traint# PRIMAR) NE) +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!!

10. Re)e#?&25$3 Thi# table i# u#ed to #tore re#er1ation detail#.

?ield name re#er1ationid flight ode journeydate Sour e de#tination Statu# journeytime

,e# ription > > > Starting pla e of the flight Ending po#ition of the flight > Time the flight #tart# 11. Re)e#?e !e <

,ata type Int Int ,ate 1ar har 1ar har Int time

SiHe %D %D FD FD %D

on#traint# PRIMAR) NE) ?OREI$+ NE) +OT +"!! +OT +"!! +OT +"!! +OT +"!! +OT +"!!

Thi# table i# u#ed to #tore re#er1e he - detail# ?ield name re#er1ationid u#ername Pa##word ,e# ription Re#er1ation id number +ame of the u#er Pa##word to login ,ata type Int Iar har Iar har SiHe %D 3FD 3FD on#traint# PRIMAR) NE)

@A

0. IM"LEMENTATION>
module# of thi# proje t on#i#t of %9Main Menu 39Re#er1ation :9 Ti -et @9waiting F9=arning E9Confirmed A9Create B9!ogin C9Me##age ;o7 %D9Proje t M&53 Me34 import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## MainMenu e7tend# ?rame implement# A tion!i#tener S Menu;ar mbar( Menu m%0m30m:( MenuItem m%Y%0m%Y30m3Y%0m3Y30m3Y:0m:Y%( publi MainMenu89 S mbar Q new Menu;ar89( #etMenu;ar8mbar9( m%Qnew Menu8\;oo-ing#\9( mbar.add8m%9( m%Y% Q new MenuItem8\Re#er1ation\9( m%.add8m%Y%9( m%Y3 Q new MenuItem8\Can ellation\9( m%.add8m%Y39( m3Qnew Menu8\Report#\9( mbar.add8m39( m3Y% Q new MenuItem8\Confirmed Pa##enger#\9( m3.add8m3Y%9( m3Y3 Q new MenuItem8\=aiting\9( m3.add8m3Y39( m3Y: Q new MenuItem8\,aily Colle tion Report\9( m3.add8m3Y:9( m:Qnew Menu8\Clo#e\9( @B

mbar.add8m:9( m:Y% Q new MenuItem8\Clo#e\9( m:.add8m:Y%9( m%Y%.addA tion!i#tener8thi#9( m%Y3.addA tion!i#tener8thi#9( m3Y%.addA tion!i#tener8thi#9( m3Y3.addA tion!i#tener8thi#9( m3Y:.addA tion!i#tener8thi#9( m:Y%.addA tion!i#tener8thi#9( add=indow!i#tener8new M899( T publi 1oid a tionPerformed8A tionE1ent ae9 S i f8ae.getSour e89QQm%Y%9 S Re#er1ation r Q new Re#er1ation89( r.#etSiHe8@DD0@DD9( r.#etIi#ible8true9( r.#etTitle8\Re#er1ation S reen\9( T if8ae.getSour e89QQm%Y39 S Can ellation Q new Can ellation89( .#etSiHe8@DD0@DD9( .#etIi#ible8true .#etTitle8\Can ellation S reen\9( T if8ae.getSour e89QQm3Y%9 S Confirmed r Q new Confirmed89( r.#etSiHe8@DD0@DD9( r.#etIi#ible8true9( r.#etTitle8\Confirmed Pa##enger# !i#t\9( T if8ae.getSour e89QQm3Y39 S =aiting wr Q new =aiting89( wr.#etSiHe8@DD0@DD9( wr.#etIi#ible8true9( wr.#etTitle8\=aiting !i#t\9( T if8ae.getSour e89QQm3Y:9 S Colle tion d r Q new Colle tion89( d r.#etSiHe8@DD0@DD9( d r.#etIi#ible8true9( d r.#etTitle8\,aily Colle tion Report\9( T if8ae.getSour e89QQm:Y%9 S Sy#tem.e7it8D9( T T 4Rpubli #tati 1oid main8String arg#]^9 S MainMenu m Q new MainMenu89( m.#etTitle8\Main Menu\9( m.#etSiHe8@DD0@DD9( @C

m.#etIi#ible8true9( TR4 la## M e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( di#po#e89( T T T Re)e#?&25$3 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Re#er1ation e7tend# ?rame implement# A tion!i#tener S ;utton b%0b30b:( !abel l%0l3( $rid;ag!ayout gbl( $rid;agCon#traint# gb ( ?ont f( Re#er1ation89 S #et;a -ground8Color. yan9( f Q new ?ont8\Time#Roman\0?ont.;O!,03D9( gblQnew $rid;ag!ayout89( gb Qnew $rid;agCon#traint#89( #et!ayout8gbl9( b%Qnew ;utton8\Che - A1ailability\9( b%.#et?ont8f9( b3Qnew ;utton8\ Create Pa##enger \9( b3.#et?ont8f9( 44 b:Qnew ;utton8\ ?are Teller \9( 44 b:.#et?ont8f9( l%Q new !abel8\\9( l3Q new !abel8\\9( gb .grid7QD( gb .gridyQD( gbl.#etCon#traint#8b%0gb 9( add8b%9( gb .grid7QD( gb .gridyQ@( gbl.#etCon#traint#8l%0gb 9( add8l%9( gb .grid7QD( gb .gridyQB( gbl.#etCon#traint#8b30gb 9( add8b39( 4R gb .grid7QD( gb .gridyQ%3( FD

gbl.#etCon#traint#8l30gb 9( add8l39( gb .grid7QD( gb .gridyQ%E( gbl.#etCon#traint#8b:0gb 9( add8b:9( R4 b%.addA tion!i#tener8thi#9( b3.addA tion!i#tener8thi#9( 44 b:.addA tion!i#tener8thi#9( add=indow!i#tener8new =899( T publi 1oid a tionPerformed8A tionE1ent ae9 S if8ae.getSour e89QQb%9 S Che - m Q new Che -89( 44#etIi#ible8fal#e9( m.#etSiHe8@DD0@DD9( m.#etIi#ible8true9( m.#etTitle8\Che - A1ailability S reen\9( T if8ae.getSour e89QQb39 S Create 1 Q new Create89( 44#etIi#ible8fal#e9( 1.#etSiHe8@DD0FDD9( 1.#etIi#ible8true9( 1.#etTitle8\Create Pa##enger S reen\9( T 4R if8ae.getSour e89QQb:9 S ?are f Q new ?are89( 44#etIi#ible8fal#e9( f.#etSiHe8@DD0FDD9( f.#etIi#ible8true9( f.#etTitle8\?are Teller S reen\9( T R4 T la## = e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( di#po#e89( T T T T5 <e2 M$64Ee import ja1a.#*l.R( import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Ti -et e7tend# ?rame implement# A tion!i#tener S F%

Te7t?ield t%( !abel l%( ;utton b%( $rid;ag!ayout gbl( $rid;agCon#traint# gb ( Conne tion on( PreparedStatement p#( Statement #tmt( Re#ultSet r#( int ount( ?ont f( Ti -et89 S #et;a -ground8Color. yan9( t% Q new Te7t?ield83D9( l% Q new !abel8\P+R +O \9( l%.#et?ont8f9( gb .grid7QD( gb .gridyQD( gbl.#etCon#traint#8l%0gb 9( add8l%9( gb .grid7QD( gb .gridyQ3( gbl.#etCon#traint#8t%0gb 9( add8t%9( add=indow!i#tener8new =899( T publi 1oid a tionPerformed8A tionE1ent ae9 S T la## = e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( di#po#e89( T T 4R publi #tati 1oid main8String arg#]^9 S Ti -et t Q new Ti -et89( t.#etSiHe8@DD0FDD9( t.#etIi#ible8true9( t.#etTitle8\Ti -et S reen\9( TR4 T F3

:&52537 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## =aiting e7tend# ?rame S =aiting89 S add=indow!i#tener8new =899( T la## = e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( 44di#po#e89( Sy#tem.e7it8D9( T T T :&#3537 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## =arning e7tend# ?rame S $rid!ayout g( ;utton b%( !abel l( =arning89 S g Q new $rid!ayout830%0%D0@D9( #et!ayout8g9( l Q new !abel8\In orre t u#ername or pa##word\0!abel.CE+TER9( b% Q new ;utton8\O-\9( add8l9( add8b%9( b%.addA tion!i#tener8new )899( add=indow!i#tener8new L899( T la## ) implement# A tion!i#tener S publi 1oid a tionPerformed8A tionE1ent ae9 S if8ae.getSour e89QQb%9 S 44di#po#e89( Sy#tem.e7it8D9( T T T la## L e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( di#po#e89( T T F:

publi In#et# getIn#et#89 S return new In#et#8@D0@D0@D0@D9( T 4Rpubli #tati 1oid main8String arg#]^9 S =arning m Q new =arning89( m.#etTitle8\Me##age ;o7\9( m.#etSiHe8:DD03DD9( m.#etIi#ible8true9( TR4 T C$3%5#(e6 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Confirmed e7tend# ?rame S Confirmed89 S add=indow!i#tener8new =899( T la## = e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( 44di#po#e89( Sy#tem.e7it8D9( T T T C#e&25$3 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Confirmed e7tend# ?rame S Confirmed89 S add=indow!i#tener8new =899( T la## = e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( 44di#po#e89( F@

Sy#tem.e7it8D9( T T T L$753 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## !ogin e7tend# ?rame implement# A tion!i#tener S String u#ername Q \anu\( String pa##word Q \rag\( Te7t?ield t%0t3( !abel l%0l30l:0l@0lF0lE( ;utton b30b:0b@( $rid;ag!ayout gbl( $rid;agCon#traint# gb ( ?ont f%0f3( publi !ogin89 S 44#etTitle8\!ogin S reen\9( 44g Q new $rid!ayout8@030D0ED9( 44#et!ayout8g9( #et;a -ground8Color. yan9( f% Q new ?ont8\Time#Roman\0?ont.;O!,03D9( f3 Q new ?ont8\Time#Roman\0?ont.;O!,0%F9( gblQnew $rid;ag!ayout89( gb Qnew $rid;agCon#traint#89( #et!ayout8gbl9( l% Q new !abel8\"#ername\0!abel.CE+TER9( l%.#et?ont8f%9( l3 Q new !abel8\Pa##word\0!abel.CE+TER9( l3.#et?ont8f%9( l: Q new !abel8\\9( l@ Q new !abel8\\9( lF Q new !abel8\\9( lE Q new !abel8\\9( t% Q new Te7t?ield8%F9( t3 Q new Te7t?ield8%F9( t3.#etE hoChar8GRG9( 44b% Q new ;utton8\Change !ogin ,etail#\9( b3 Q new ;utton8\Re#et\9( b3.#et?ont8f39( b: Q new ;utton8\Submit\9( b:.#et?ont8f39( b@ Q new ;utton8\Clo#e\9( b@.#et?ont8f39( gb .grid7QD( gb .gridyQD( gbl.#etCon#traint#8l%0gb 9( FF

add8l%9( gb .grid7Q3( gb .gridyQD( gbl.#etCon#traint#8t%0gb 9( add8t%9( gb .grid7QD( gb .gridyQ3( gbl.#etCon#traint#8l30gb 9( add8l39( gb .grid7Q3( gb .gridyQ3( gbl.#etCon#traint#8t30gb 9( add8t39( gb .grid7QD( gb .gridyQ@( gbl.#etCon#traint#8l:0gb 9( add8l:9( gb .grid7Q3( gb .gridyQ@( gbl.#etCon#traint#8l@0gb 9( add8l@9( gb .grid7QD( gb .gridyQE( gbl.#etCon#traint#8b30gb 9( add8b39( gb .grid7Q3( gb .gridyQE( gbl.#etCon#traint#8b:0gb 9( add8b:9( gb .grid7QD( gb .gridyQB( gbl.#etCon#traint#8l@0gb 9( add8l@9( gb .grid7Q3( gb .gridyQB( gbl.#etCon#traint#8lF0gb 9( add8lF9( gb .grid7QD( gb .gridyQ%D( gbl.#etCon#traint#8b@0gb 9( add8b@9( 44add8l%9( 44add8t%9( 44add8l39( 44add8t39( 44add8b%9( 44add8b39( FE

44add8b:9( 44add8b@9( 44b%.addA tion!i#tener8thi#9( b3.addA tion!i#tener8thi#9( b:.addA tion!i#tener8thi#9( b@.addA tion!i#tener8thi#9( T 4Rpubli In#et# getIn#et#89 S return new In#et#8@D0@D0@D0@D9( TR4 publi 1oid a tionPerformed8A tionE1ent ae9 S if8ae.getSour e89QQb39 S t%.#etTe7t8\\9( t3.#etTe7t8\\9( T if8ae.getSour e89QQb@9 S Sy#tem.e7it8D9( T if8ae.getSour e89QQb:9 S if88t%.getTe7t89.e*ual#8u#ername99__8t3.getTe7t89.e*ual#8pa##word999 S MainMenu m Q new MainMenu89( #etIi#ible8fal#e9( m.#etSiHe8@DD0@DD9( m.#etIi#ible8true9( m.#etTitle8\Main Menu\9( T el#e S 44=arning w Q new =arning89( 44w.#etSiHe8:DD03DD9( 44w.#etIi#ible8true9( 44w.#etTitle8\Me##age ;o7\9( Me##age;o7 mb Q new Me##age;o78thi#9( mb.#et!o ation83DD03DD9( mb.#etIi#ible8true9( T T 4Rif8ae.getSour e89 QQ b%9 S Change Q new Change89( .#etSiHe8@DD0@DD9( .#etIi#ible8true9( .#etTitle8\S reen for Changing !ogin ,etail#\9( TR4 Me))&7eB$C import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Me##age;o7 e7tend# ,ialog implement# A tion!i#tenerS $rid;ag!ayout gbl( $rid;agCon#traint# gb ( ?low!ayout ?( ;utton b%( !abel l( ?ont f%0f3( Me##age;o78?rame fm9 S #uper8fm0true9( FA

#et;a -ground8Color. yan9( f% Q new ?ont8\Time# Roman\0?ont.;O!,03D9( f3 Q new ?ont8\Time# Roman\0?ont.;O!,0%F9( gblQnew $rid;ag!ayout89( gb Qnew $rid;agCon#traint#89( #et!ayout8gbl9( lQnew !abel8\In orre t u#ername or pa##word\0!abel.CE+TER9( l.#et?ont8f%9( b% Q new ;utton8\ ON \9( b%.#et?ont8f39( gb .grid7QD( gb .gridyQD( gbl.#etCon#traint#8l0gb 9( add8l9( gb .grid7QD( gb .gridyQ@( gbl.#etCon#traint#8b%0gb 9( add8b%9( #etSiHe8:FD03DD9( #etTitle8\Me##age ;o7\9( b%.addA tion!i#tener8thi#9( add=indow!i#tener8new L899( T publi 1oid a tionPerformed8A tionE1ent ae9 S if8ae.getSour e89QQb%9 S #etIi#ible8fal#e9( di#po#e89( T T la## L e7tend# =indowAdapter S publi 1oid windowClo#ing8=indowE1ent e9 S #etIi#ible8fal#e9( di#po#e89( T T T "#$'e 2 M$64Ee import ja1a.awt.R( import ja1a.awt.e1ent.R( publi la## Proje t e7tend# ?rameSpubli #tati 1oid main8String arg#]^9S !ogin ! Q new !ogin89( !.#et!o ation83DD0%DD9( !.#etSiHe8:DD0:DD9( !.#etIi#ible8true9( !.#etTitle8\!ogin S reen\9( T T FB

6. E="ERIMENTAL RESULTS>

FC

ED

E%

E3

E:

E@

EF

7. TESTIN->
7.1 I32#$64 25$3> Sy#tem ,e1elopment i# a pro e## of on ei1ing the #pe ifi ation #pe ified in the de#igning #tage into #our e ode. Careful #tudy and ob#er1ation about #y#tem de#igning were made and a ordingly the #y#tem wa# oded to on1ert from de#igning to #our e ode0 where 1i#ual ;a#i a# the front end and Ora leLE a# the ba -end. The Sy#tem wa# de1eloped #u h that it #hould be u#ed for the future enhan ement. All the module of the #y#tem i# ombined and i# put to the operational u#e. Thi# mean# that the new and old #y#tem are run in the parallel for #ometime#0 error# are identified and the orre#ponding error# are to be on erned to get the re*uired output. The #et of wor-ing program# and initialiHed table# are al#o pro1ided for the ea#y #tart of the u#er0 in addition0 #y#tem do umentation i# al#o pro1ided0 and all u#er# ha1e been trained to u#e the #y#tem. Thi# reate# two problem#0 The time lag between the au#e and appearan e of the problem. The effe t of #y#tem error# on file# and re ord# within the #y#tem.

7.2 TD1e) $% 2e)2537>

7.2.1 U352 Te)2537> "nit te#t i# de#igned to en#ure that the purpo#e for whi h it wa# de#igned for whi h it wa# de#igned for i# fulfilled. Ea h and e1ery module wa# te#ted indi1idually with the te#t data and error me##age# were di#played for in orre t and #uffi ient for entry wor-#. All 1alidation wa# te#ted to orre tne##. Te#t data were fed in and re#ult# were reated he -ed for ontained the maintenan e module0 to en#ure that all table# nothing but 1alid data. Re1erential integrity EE

on#traint# #pe ified a# part

of the table definition wa# al#o te#ted. 7.2.2 I32e7#&25$3 Te)2537> In integration te#ting a #y#tem te#ted for problem# ari#ing from minimum on#i#ting of different module# i# omponent intera tion. Integration

te#ting #hould be de1eloped from the #y#tem #pe ifi ation. ?ir#tly0 a onfiguration mu#t be integrated and te#ted. In my proje t I on#tru tion and te#ting with atomi module#. After unit ha1e done integration te#ting in a bottom up fa#hion i.e. in thi# proje t I ha1e #tarted te#ting the module# are integrated one by one and then te#ted the #y#tem for problem# ari#ing from omponent intera tion.

A.3.:

Re $?e#D Te)2537>

Many omputer ba#ed #y#tem# mu#t re o1er from fault# and re#ume pro e##ing within a pre>#pe ified time. In #ome fault tolerant.ie pro e##ing fault# mu#t not to ea#e. In the a#e# a #y#tem mu#t be orre ted within a ur. au#e o1erall #y#tem fun tion

a#er# a #y#tem failure mu#t be

#pe ified period of time or #e1ere e onomi damage will o

7.2.4 Se 4#52D Te)2537> Any omputer>ba#ed #y#tem the manage# #en#iti1e information or an improperly harm indi1idual i# a tablet for improper

au#e a tion that

or illegal penetration Se urity te#ting attempt# to 1erify that prote tion me hani#m built into a #y#tem will0 in fa t prote t it from improper penetration . ,uring #e urity te#ting0 the te#ter play# the role of the indi1idual who de#ire to penetrate the #y#tem. The te#ter may attempt to a *uire pa##word# through e7ternal leri al mean#( may atta - the #y#tem with u#tom #oftware de#igned to brea- down any defen#e# that ha1e been on#tru ted( may o1erwhelm the Sy#tem. EA

A.3.F

"e#%$#(&3 e Te)2537>

?or real time and embedded #y#tem0 #oftware that pro1ide# re*uired fun tion# but not onfirm to performan e re*uirement# i# una eptable. Performan e te#ting i# de#igned to te#t the run time performan e of #oftware within the onte7t of an integrated #y#tem. Performan e te#ting o ur# throughout all #tep# in the te#ting pro e##. E1en at unit le1el0 the performan e of an indi1idual module may be a e##ed a# white bo7 te#t re on du ted. /owe1er0 it i# not until all #y#tem element# are fully integrated that true performan e of a #y#tem an be a# ertained. Performan e Te#t# are #ometime# oupled with #tre## te#ting and often re*uired other hardware and #oftware implementation. It i# often ne e##ary to mea#ure Re#our e utiliHation .;y in rementing a #y#tem the te#ter an un o1er #ituation# that lead to degradation and po##ible #y#tem failure. A.3.E :!52e B$C Te)2537>

In white bo7 te#ting -nowing the internal wor-ing of the ba#e0 te#t an be ondu ted to en#ure that internal operation# are performed a #pe ifi ation and all internal pro1iding te#t ording to omponent# ha1e been ade*uately e7er i#ed. #et of ondition# and loop#. ;ee3

In white bo7 te#ting logi al path through the #oftware are te#ted by a#e# that e7er i#e #pe ifi "#ing white>bo7 te#ting #oftware de1eloper an deri1e te#t a#e that $uarantee that all independent path# within a module ha1e eCe# 5)e6 &2 Ee&)2 $3 e. ECe# 5)e &EE E$75 &E 6e 5)5$3) $3 2!e5# 2#4e &36 %&E)e )56e. ECe# 5)e &EE E$$1) &2 2!e5# ;$436&#5e) &36 @ 52!53 2!e5#

$1e#&25$3&E ;$436. ECe# 5)e 532e#3&E 6&2& )2#4 24#e 2$ e3)4#e 2!e5# ?&E5652D.

EB

8. CONCLUSION> The entire proje t ha# been de1eloped and deployed a# per the re*uirement# #tated by the u#er0 it i# found to be bug free a# per the te#ting #tandard# that are implemented. And by #pe ifi ation>untra ed error# on entrated in the oming 1er#ion#0 whi h are planned to be de1eloped in near future. ?inally0 we li-e to on lude that we put all our effort# throughout the de1elopment of our proje t and tired to fulfill mo#t of the re*ui #e(e32) $% 2!e 4)e#.

EC

9. RE.ERENCE> :e;)52e) http244www.google. om http244www.mi ro#oft. om http244www.programmer3programmer.net http244www. odeproje t. om http244www.#lide#hare.net http244www.%DDDproje t#. om http244www.fir#tload. om

B$$<) Introdu tion of Software Engineering0 Bth Edition The omplete referen e of Ja1aTM 3 0 Fth Edition SM! ;ible0 3nd Edition 8Paperba -9 ,ataba#e ,e1elopment

AD

Potrebbero piacerti anche