Advance-Java-JDBC-2
Advance-Java-JDBC-2
) Gonneekion Pooltng
Tn Scenourios here cemnection poaliny is
ed (reusing connectin instead ocf opering
alocing Arequenty) Not closing a
coonlion properly
exhaustion inA
an lead tortsouree
conne ctionpaat
2cticn. doseC) is coaled within Finally
block Are that the connection is clote
to ensere
Yeqordless ef whetther an eraption ocuring
diint databaue aperatiens
It's wrapped in cy- Catch hlock to handle any
patenbia! sqL excepttn that miaht oCcur whiled
clouing he C¡mneotion.
’ Its crueal to check ?f the connectin s nul
nok befze attempting te close
dlare iAit.
as null checks perents oull poicterExcaption.
+Porocedure Creaing
) Proper namin
Use meaningful names far pracoure
which folou porapernaming CaDventions
) Documentation -&
Comment dacument pracedures foe
futurere ference, (in comment box
1) While (reating procedwe, table parameters(sid, s.rur
Should not motch input/output para meters mbiquiy ef
How to call Stored procede JavaApplicoi
(6 - CAU- stoned -.procedwe) prgram
allable Statement :
’ A caldableStatemont
in Ta Va an
the TDEC APT uued to
functions io datoabaleexecutestored procadzres
’IE extendi frepared Statement Interface
Adantages o
Hiecarchy
>Hieraschy ot Stateonent, Prepared Stakement, CallabieSteeone
These are interfaces used for database operatioms,
but they differ in terms of functionalitie 44
their positicn hierarchy
)> Statemunt Tnterface
It is baye interfacein hierarchy andit
to execute simple sgl statements
atnerally wutd for execaking static guenies
woithout parame ters.
Methods ike executeo, executelUpdake () 4
ane. this interfac.
part of
2) Porepored Statement Ioterface i
I t extends Statement Toterfare.
S More speciaised intecface ued fo
executing p-compiled sal statemeots.
It alloo you t e execute cånamic
queriesthaf Can be set before executen
3) 4 Callable Statement : Interfaa
extends PrenordStatement
) IE to handle cecdi
soecialised Lo
It isfurther
of
OF stond racedurein datahae.
’ Tt enables handlng of input, output f
input loutput partneker.