Using netunauge to cotnse 08 data sour reduces pvtbilty becsuse the appstion must iri a
gece JD sive clase nore od der URL. Tee de loss rae ens der UAL ae specie 0 IDE
“ono, var imalmertatien, and data eource Ifyou apacaions noosa be potable among das sources, you
hol ue the Deeavare eae
‘han you connect oa das source using the narteass interac, You Use oenatvares OC Mis possible to
{toate anid use the oweaeeee objet in ts sate applesion, ss YOU do wih the sereotnanr nears Figute 5
Shows an example fr the DEC Lnerssl JDBC iver
gue 25. Crating and using 2 DataSource object in ho ime agpleaton
supoxe jave.ast.s: 0) ssc ase
Sepoct yavei-agit2 —)/ SDOC 2-0 atandaed exesnaten APL
Sepoct con-siaudb.Jeo.77 // 0821" Upivereal sac Desvee EW
1) snectares
Dpcsiupiebecasouroe ddontey Dees IupieDecasonrce() 2
tase, 2etbecabagcans "eb21602"|7
2) Ageia the Lacacion mane
danza setnescespeton("aor Senpie Tatabect");
(/ beceiztion C34 docuxsavesion
ade setlsee "308m"?
aide setPanseoed("h2"|
conection connm2e. gextunnaticn()! a
1) Cowete a Comnacticn sbiect
Eats sane saat ces tse
Hewever, + more fxible way 9 US a nacaseece chet iso our system sdminststor to create and manage t
separately, using WebSphere or ane char ool The pos that cates an hanages a arenas objet
sle0 oes thoi Naming and Decor reface (INDI to acpi rame to I nasedneee ack,
‘Ths JOEL apgieation that 429% he Oaranaee aback can the eer otha abject BH ageal ame, and ers no
reed sn) mrmaionsbou the undetying dst seuce In addon, your system amistsarexn mod fe data
our sinbutas and yeu do net eed to change your apleston prog
To lain mote about using WebSphere te deploy OstaGoutce abject, got this URL onthe Wad:
actgs/ foe.
con software /beesvene/sppasre/
‘To ain about deploying DataSource aborts yous, se Lu dosloy DataSource abioct
Yuan use the ostateece isco andthe cetvntinare tac the Sar applctin, but for maximum
obi. if Yacorimanced thet you use only io arernee tear te aban sonnet ons
‘The terainder ofthis opie evlsine how a erste comection using @ macaeace sea, ae thal the System
Sisto hs seat resto he object and assigned ages nam to
To alain a connaction using soeeatnoee bert, 04 mee a fll th
2 steps
1, Fem you systom anita, ota the lage rae othe datasource i hich you need ta carmel
2. Greta 3 cnte abet use nf noe Step The Consens face ie par of he Ja Narang ane
rectory neice OND, net JDBC
3. In your aplcston program, use JNGIto get the aearsaee objet hit is assoclaled wh th ogcal ta
4, Use the naearoece.seecaonceton meta te cain he connection
‘You can use one ofthe fluwing fons othe gextomnacson tho
ary
Sectmeccioa|Siing wear, String password)
Use the second Sonn # ou nes to spi a usarlD snd password fate connection tht eileen fem
the ores tha were spacifad when the aeasnres WBS fled
Fiuue 58 chove an exsinple ofthe code thst you toad in your application grogtam 1 lain a connection sing 2
Davao abject, gion Ia he gla name ee da seuso> That ou noes in eortent 0 athe segt ay. THE
umber otha night of selected satemante coreepond lo the prevausiy- dered ope,
Figue 9 Obtaining # conection van & CataSouce atect
sepoet yave.a 2
Sapoxt Javataaaincs 2Context ctxney InitialCentext(|7
Conestaen caneds, getconnescsan(2
Related tasks
‘This topic can be ound in. Apccaton Develonment Gu, Pogrammang Chen Agalcatons