0% found this document useful (0 votes)
22 views9 pages

20331a0547 WT Assignment-6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views9 pages

20331a0547 WT Assignment-6

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Cb LedlaMbana atta

2033|A OS44
Assignmant 6
CSE-34
Explan TDB C Dvas rth ncat shcteh
TDBC niven
JD8C Dniven softsanc conponent
that en aßles java afflicocton to intencd
oth Data base
hene hypes of TDBc do vens
OJDBC^ ODBC bnidge dven
o atue API dven Cfantially Java,dnn
Nehoonk Protool drivn Cfally jwa dnion
Thn dnver Cfuly java drna)

dnjvoto conne to daabog


SUses oD8e
Convots Toc
TDBC màd cals into oD BC

function calls
Jhis s nO ds cous aged
dniven
JOBC-oDBC Bnsdge Dive

JdbcAPI)

SDBC- OD8 C OD8C


Java -Aplamon bnidge DnieA D

Vendor
Dubae Dotoba

Java Bni dye has bccn Teae


TDBC- ODBC
Onade doesnt subrot)iapt
Instead Chacle nccommed hat to use
JDBe .dovespraudet by vendon otdtae
ned st JDBC-oD BC
bridge.
(Uses clent Side Gnantes ofDatoks
T6 dveh' Convents TDBC methd callk b
natvecals, ot databane AP), .
. S not entinel, onlen n jaual.
Tse AP

Java Applica ndo


Databa
Hon API D\yer
dot
Clent machire

3 Yeboon k Botocoldiven
Uses midlesanc Capplication Sevon)that
Convcrts TD B calls dinecty lindincety
into the vendon -spcafic atabase
fally bnthen fava - tn

pnotoco
Netaonk (MJlemne)
Appl
Java Aplica
aPoblol
tion Dniver Datul
Chent machnne
Thin Drava
TDBC calls dinety tnto fe
the
Cowals
dakabase fnotore That swhy
Vendan ßecchc
Hs-fill. nles Javalanyare
Jsbe API

Taua Applica Thn Dmve


hon )
- Chent machne Data bar
Thin Dnivey ote
Wnitea bnicf nte on.clasos
intufaessuponted: by Jaua sql*
pacfage
The ava sql* fackag
set of classcs
nJovo

Pnoudes a intafas
fon access)hg mani'fulachg date strel
nelational datu bases .
Herc ane bel Sane closes

Drveri (S an
Intenface tkat
pnovsdes nmetal fon neqistnngf
d1vens
Connechon: intenface n<pnesens
cohnechion to froy1des me kodsta
cncabng statmnts mahagny
Statcment
intaface ncpnesent aa sQl suteent
tfat can be cxeauted agans
methods ton crcetng
SqL Gucies ufdates
4 Pnepangd Statement
subintenface of stalement 46at
refncscnbs frcconfiled sgl ctatenont.
CL

H provdes aLoay to fananeteje sgL


quenics

Result Set
ntofacc that fnes ents the natt ofa
sOL
SL quey
PBovides mctkocs ton tenabng
ndivdual columns
accessM
(6) Result Set Meby Data
methos an netnicuy
trtnface 46at frondes
Colinnsn Rrsutst
metadata about
spL Ecephon .
Cvnall Jauasgl-* package fronks
poserhd sel ot -tod on sonking bta
belational dotabases n Jua
devekfens h csily Connet database.
execute sgL qunes
Splan how to connet a dak a

A odo load
JsP

the databese diven


nncet.hicode
Eoflaun orth sutaßle code

finstl boe have-to Coad -the database


dnvo ton the daa base you 1ant to
Connect to you carn dothis by using te
dass fon lamec) metfodb oad-tR dver dlas
Sstablish a database Comechon
afta stefl ve netd b cstabls h
databasc connechon: using
Dniven'tManagen qetConnccbon C' wnctfod
Exccute sqL Quencs
after, cotabl,ahung' database
co nnechon you can, te
exe cute sgl glces
siny
<ho pagc tmfont jasa sql.">

class fonName C"com mysglEc Doivn


Lol = "j&bcimysgl: //ocal hodt 330
ny dlatabose:
staing "user";
Shing fussaondi pas bond';
Connechion conn:DaiverManaqenqct Connechisn
(ual,sen. fosnond),
statement stmt= cohn- Cncate StatementCJ;
stang sql "SELECT

Result Set n5 sht- excute Gucy (sglD)


il Paotess quy nesults
khile Cas not) i
out pmntln('io:" tns qct lat C"aj
out fanla C"Nlamét ns qtlot C"ndi +cb)
out bnnta ("Emal" n5 gettat CGmal")4
Ns- Clase C0,
stmt closc CJ;
Connclose C);
Dnte JsP cole to ufdate cmfloye
Lok-to 2ck heu
Salary from CmentiÛn
fou asnptiom).
-4 tafken
flon emfloye 1D as ah

infect trom

<Rady
ttes Chlate Salagof Euplyee<|htley
</6cady

int cmpld- Tatyr frnat Cnquat gtfRant


cstaslsh a
Conncchion.

wl
Stog
Sfong usc -"useoha me
Stomg fas od jussorel";
Comchion conn - DrwaMonga qetConsctn
Cal, uso assa)
"o pDATE tnloyee seT
> 20c00 he Lmplas2)
Prefaned Satemet stt- conn pnfn Statemeat

int nos Updated strt excate platec);


pdated)s
ingployce Salay Updlate
outfant, Ennen).

shtclase)
kbun clse)

You might also like