0 ratings0% found this document useful (0 votes) 36 views23 pagesJava Assignment
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
w~
\————
Assignment= 4.
\
=~ Is. Collect A
a Woot ta eee Framemavk 3 dl
het -_Calleckfa ameway hes ich
Alane owas ec Antova 19.4 unitied >
oS |_-onchitec or emesenting and. Sanu pulating —-
EL | totlection _ol obiecis. Sree a2
ip [AL _provideS_a_Sel_ol Inlextoce,Amplementatiag,
cr | -and- algoriihms _ +o Odor Git, anasto
| etiicienty: wy t of
—
| queue. oad Map alan afite their ‘rnplementing |
+
~___-Hoshnap-
____| Inger} _tine elem
- add Cint Index! FE element)
Son In Verh -
3) 4at Ca padiy (>
|
|4) fink Size CD
Th neknns the Gize ot vecter.
5) gEmpiy
Th velurnd nue Tk tre vector 1 empky ——_——
® Clear ()-
Removes all element In Veta
———|
Ret
~~—1) Contotina Gobfeck_a bY) _________—
— | tt yelurn ve 4k the verter Cantdin ot the —
aa
Sperifier| element: 1| sas
a ganing, al §eHIg Code———
i “4 (Runnodie Ko Running . GeHing
[Gotti ,
| Got Sesmramaar} !
I [Boned = x + TORT meted |
| \ exieg F Batis Treverinatad/ |
ead1 65 aclive Stale — 4¢, :
| esning ayale. 1 either in Nunoble_oy
[9 Runnah\e re —
- an an) a0 Sole a ime, “ : A
[ab 45. duty ot Schneider de gor Eady torn
f to aun thal‘ moving ‘ne Vervead, thread tiene
© grate Tcruaniag
(= Tach thread suns Shark span ot -
; inne_ashen_
| antocaled in cpu _tnis works 10 Suntan
i I
j= uheneve'y_O_tnatad 1 fa active fer a _ponticuler
|
ae [ex In an watt acting stale.
p= When execution ferra trrreod _tokes lang peried —
Ob Hme 44 leado +o Stervatiaa-
= ohen tread ia ie In the axiifing Stat €.
ae
Bias cs OSHoahrap 44 on _unoxdered Collection cstiile
| tree nap 4 4
t Suitable for tread ——
| “Operon _unlil_unles Sychronized - +
I explicit
—_
j ae method —
d
1 € scenes
\ a
ee)Set
[oy det_Keye! ©-
jg obfect lasike yc)
Jay. fot Size a
3) conection values c)..
anile- “a_ program Using hashtable ; i
name 4 phone. “Pure Ot +099 Hoo en feedeiata
© Amport—Tova.uMil 4 tthe | a
Penarth Pol seibesy .
__Hashiable_USer =_new Hasntaplecd
| Enumeration _nomes y
Sning Shr)
ot Gindenk-pur finer new Long (4128Bg03)) ;
User. pur" AMI", new Long C 351432209)*,
__|_tisea put C' pial" ne long(83an21B8)),
| User put CAjay", nay long (QaiarVEp,
il Names - usey. keysc) }
7 iphile Cnomes. hoprime Elements) _—_. .
| = ‘ ALC)» —_—
a 4 1D Santen pliner“pases Bis
IL
— < peller than TAU process,”
——~@ [united oq —_ ———_ Lo
L I Comment, hoa_higne. ovetnend ond log. |
3] munipno cesolag Pe pvedding due tothe 7
J etriclency MO anaqment_oF pa ‘89—Contexp >
| crealfon and — Conamunication cog} . ao
| quitehing pmeand— pede a
a execu 100 trrege) >
1 anile apo erat ied asielheg ia
| one _Hrvead —asLl_pr ; er 7
I “tnvead_osill_prink odd MO. between | _te Bo ee
ee
Suncmanized Clack d
: cite, CA 1p Even‘tuan) L[-aypiem. ‘oul: ining” Even pamber ho
; Mm. Sere
Even ua = foloe —
5
foot noii fy Cy
|
st
L i ‘
ys
fe
qyread_oddthead = new “Anne
HM _for_Cink = 1 14 = max 1 =e
Gens2.
sgignment =
Assi mae Zo
explain _dyncmantzalfon - How ie. NP a
Se ee a agate
_— H) Gyncmont\za No ple. thread 7
an | torteal the _access—_oF mavltlp 7 = ony
ou7ce +__— : Ae
| Shared eS ale A,
- 13) syndy nization 49 _mony- SP UIE toe
| wan} to —allow— only One ae £85 the
[Shared ee Sue @
| 4 +o prevent “the fear Solertac®
Tite prevent consistancy prmblen
_ (3) There ane _fe09. typeof - ee
i
| ii) Thread Synctront atian
4 ‘i js Io
me oat to -oildu only ane thread Fe
| te gcc0esg Gharvaed rvesaurc@
Sample =
ght aaa extends thread)
L Y of" wo y
Id 1 ‘Hutt 4
- concep)" 4,| :
f jgyncmronized Veld. ASphoy CSning Name)
—_ |
1
[an 12011 MS4-lengih > 444)
fon
een Out. PAN}\N Cram Vooog ut
‘ 3
ne “Goss _Mysyachro
~punifc static vold_main Citing ngs)
= MeN) _mnythread (read 4
mythrecica) to = new ray thread" Treacle ¢
hie Gtarte)
ei 4 i ———_1 . 7
]) puntic_-¢
public gaitc void
paxent pavenh = now. Parent 9
@ wend
vaid display Qa
jailn Clover vidden dis
Systenn ol: p>
4n_ananyrnovs
oT
1a99 twain £
J} main Cahing C4 eras L
aPlOY me
clase) 4
T
tt ze Apel feation | fc
j : ‘oven Jobe-onke \ 4 {heen ae
[oe (bridge ave Gow \ leona
oe et
a
—= 108 ¢-008¢ ridge aieeee fen mance decrease. because,
| qe converbed to \ne DR fone:
c ts teni|
») odbc ravelS need jo 4
Mon _cayy
© 8Nstail_ |
+ a
_ machines —____ —_
= Chie,
~The -havel- conver} ADRC metnad cg!) inte tne is
i nave cals at Database fer
Le aL ———_—"
fy : 5 0
_fotach client mahine es
2 ne
oN ; cA
7 JJove
pppricalion | |
| protacal
| Bdvanteye9 =
@) 1449, Fully erederr $0 $0
2 <. 5
_ sewer perferm many task (ie pudding load
| : ‘
piancoing Joga iag ote
Im b i
| pnachine +
2) the require clatabase Spedit'o Cade ta be dane —
middleware
2) mafatance te_nekwor proteal daiver became —
prey herauee iL aenurye databas © Specttic ced
Y in
be_dene.in middlemme“py the tio rive Conver} —“IDBe_Cannd dizealy inte tne
“vender — Specific — datapase _pnotecal__nence it iS Krewn
7 95 Abin— dnivey
i “an fo 4 fully elem Inox EI = it
Be icmante Mon oN
- ethan othey _derivey —____
a wate 1G acquire as tne _clent_cY ___
—_ Damier depends Upon. dlatebase +
J uiiie a orroqpram te add tne element ot
\ype §nieqer
Snra Ane hash ek ond print ——_" design, of 10
eg SE faciiitare—datenseg SY
Egplain—
connectivity) PO
orn. 0) 30VO opotcate a
pase. availa an, ane
\) There cre mn _82_man
mon Kel IKE yee 8 "Sybase erat
“exiending dova_ ‘un mineaiiens2) Nolive AP cyivey
osQ 2) Nelwoyk P1010 Col_dniyey
bac Hy) Thin. dviver .
the do you execule
2 4 ow \ ecu SQL Sialemens in 4
pibere yp 1 Explain. eaitin an exampie 2V0 Hsing
FEN) King a database
4 Execul Using means Cece gsi
Iie } fom dabonse - q Ne Gales
a -
. [a0_general— to_moess_an S01 Stalement ah
bi “we fellow these reps tT Simtnae -
Ime,
a Esta biisting 0. Connection = Eis establish acannen®”
rosie ___ twit the data source ewe -coant to use.
ae a date Source + dete aefresemting 2 dalabene
-DAFIS—a_leqacy fie _Sysern_oy Gome_otner sane
-o} date with a. Serreapanding I0Rc driver,
“ld create o simement - Sratemenk is an
interface thot represent 0 S01 sinlement,
“fine"esise Silent thes cd ney gence
| Resuliset_obfecis —~O Connection is table ot date
4 leintcideital pata Hiaiglalsteldits
/@treparvedSiaement~ Used _ferx re -compling S01
+_@ielemen {hat might Contoin “input _paramelers.—
10 callanieSiolement = Used to_execuie- Slexeel — =
—fhacedurveS tha _moy Contain oth inpud # —__.
the— - to execute oF ape ‘tah AIO
eal ree Stole are nish ete ilySe ar
ye Tt \e_fnsk—oblect bat tn Pai
Resuiises objects} 8
Relutn one _Resuliset ob.
p_an_inteqer “ye preSentin,
ed) bythe SQL
ons
‘query ety As
execuie Query-—
© execuievpdal e— Rely
5 oHeck
7 > §eapart Java. Sal"
C ic —var'd
‘al ove
|
t Shing sey = “
a | hing a Soe skeet Meg
Apa
| iy A pass your possuoard'"s
= 0
-Connciion Curl, user -
el ) :
= a
4y seonse 50 ae
!
a gintemenL-ClOSec>s mini ose
4 “connection - Close 02",
1 [ance ent e\ fo:
-paint Stack Trace | Cyn
Timea ie onsale ae tet S-mys0l_y
a fiom Boxe. Sal Se —
Tounitc_class Update Recon} ef -
+ puniic tafe Vaid mnain dtsomae ——s
oo ee
Dlicnetle 8 Npr-dlae
TY Shing. user = your“| tn Caowsnstocied zoot
Syslem- oul: puiavin
SE ecto
_ | sigysiem ou): prniin Fatled 40 updated retend")',
{ peneleiemest Ose —
dds \,
Ne
- eee ;
Pee epeeeee ecco eh a
L i catch CSQLExceptan art a
a . .
i ye niGtack Trace CD 5
ry
a a_nequee’
y I
poonsentel 9 magia
SAF ny 80
3) p_sewlel 1S_Guppmped_
and applfcation -2EWENS,
“yp gewlel Io
“vano) 16-0. sewiey 49 Joas Exp
jovo.3 Ey
and hieven chy of Sevier
writen
Sewer APPYcation +.
: ANg
DY_Vinjuoly
ye ual ioc
a_technolo:
foe be
I Stoat
1
Loading and
fostantolfon
Jottiolized i.e now!
ready for Service)
| Sewicecy
Handling
request
Gestoy¢)
UStng JOVA_tha}
WET Clients,
oll wep Servers
to, eH coemethod Wn OeF viet
Jane Wecycle
DJ amt & method TS Anvowed
Jy ame drives meiner ta designed a be Catted an) aa
ance. WO
Layali 15 coed gerviel 19 Krad created and not {7
| exeaied called again for each 0 S5er reques) Pa
ser goed _ for one-time. ‘Witializattans ust a5 eas
with yne ‘NL Mmetned ot applets yo
Fa) ane nito_melnod definition looks like this e
puoiic_void {mii throws Servlet ExecepicN ag
4 7 | 7 o
J 4nitiotization Code — ae
2) Iseus oo a 4
rere method 4 ‘invaked — a
1) ‘Ihe _sewfice_ meine J the _moin Method ak aes
Ser a. te
| tne actual 405k cd 48 peter
e
—_ [tne Seiet Canieiner_cowla_the Seavicé metned _
|e handle request centetiolag coming from tne
Client prpwser
yand to gniie tne formared back
—+6_client, ed ‘g
ee ; © 8 4
——
ic_Unid Service CoewieiRequest request. _ a
- Servlet Ri wean i
Mel Excepad , oe aeee ee: 7 1 hom ON HIML form they has no
on f-Snould be handled by dnneins met Spectiod _
aa ‘ete Void Seal Cte melReavey Teques), 3
} pow Sevulel Exception , “eta SPonSe 7espange )
) Sewlel cade.
@rtnedoPast OO meted — Apes
“hem had Speciiicarty AYs\5_ Post. -OS the Method ond _
44 Should be “handled toy AoPaa}C) metnodcd: =
pubic sid _cloteat Cuipgentel requeauesns
So aoe aesnse)
ay —-fpous SemetBurvon .aebuepion
phi Se totais , =
St Yeauest ham Wot
——This_metned gives the ewel_achane to cae
—_ddlabase Connection 7 eel
——4 rr sai
) Ohfeck fo marked for qarbage Callection. the ee ee
a _ method clefinition look MWke this - ns
~ Po Sittee cee
— Spite vid_aesioye) — — +
ee code. — ——_—__
Nt — — a walaK Gerviel
pierarchy OF 907"
Tiyseviet [ tn
f yferonchy ob H11P Sen lee
[ ya he Sewie) 9 the ‘rook interkace. Of the Serve}
|_c1as9_bievarchy-_— —— ——$___-
|.2) AL) Servlet — need_to_elther direc} 6% Indiverty 7
| 4enplement the Serle) inter fee =
|s) the Generi chemo} _claS$_ak tne Servlet B07 Inpiersen:
nods. ferr_b 4 proiccal-independen_Sewiel. ~ ~
at —S) The _genericServie+ class detines genevic Sewer,
Side _cperation
Ihe HitpSeriet exlend this ta deHne Hip Specie
Ne)
= - — operation -
+ fipptication Specftic Serviels extend this to ~
| pacuide _appifcatian Specie operation.
1 eae ot a ~ is
i Dfecuss the atterence ‘between GET Post
———;-eaues}S 4 Senyiels. Alhen_onould you use _——
aoe
des pa etter| Post Request
cose ol Gel “equsianly ) an case ot pos requesy
aie amoun) Ol dala can | \arge. amoun) of is Lh
pe gent because data Issent he Sent becawoe dota is
gn rend ey — {Sent tn ody
got n2avest 1 not Secanel 2) prot request Ns Gere beate
epivse data 1S exposed in date 6 nob exposed 4
st RL be ass
yeavieat Con be book. _3) Post request cannot be —
heokmarkecl
request fs dempatent _§) 9 Pose nee nen gem
Sige a Saige hace Ceara ae
nt_ond Used more | _effctent 4 used lesg than
Dost. IS} gek _
el
a hethod_-
SF. ) The GE1_hetnod Send and encoded _uses Intenmatan —
|_appendecl to the page request.
ly