Question { TCS, 5617 }
which scenarios we go for jdbc,and which scenario we go for
connection polling and wat r advantages and disadvantages
using connection pooling.
Answer
See from first onwards i am speaking
there are two types of connection object one is Direct
Connection object and second is Pooled connection object
The object which is created,managed ,destroyed manually is
called as Direct connection object and if connection object
is collected from connetion pool is called as Pooled
connection object
now let us see each very clearly
When ever we try to create connection object than new
connection will be created ,ok,now when new clint will come
dynamically than he will use readily available connection
object to have interaction with underlying database
software,now , suppose multiple clients will come to use
connection object than what happens, Since, we have only one
connection object than we can provide service to one client
at time , i mean second client has to wait till first client
completes his work , think about large scale application, i
mean if more than two clients will come to use this
connection object e.g. Banking application .Definitely one
connection object can not provide service to multiple
clients , see , it can provide but will take much time to
provide service .ok, now think about our passions ,hardly
how much time we can wait for twenty thirty or forty minutes
but if it exceeds than what will happen , suddenly you will
leave that bank and will close account and which will , in
turn , mishap on organisation who has developed that project.
So , we have to provide service right there exactly
connection pool will come on to the picture.ok, so it is
highly recommended to work with connection pool concept.
now another thing is jdbc see
jdbc is a specification given by sun microsystem and it is
again devided into four types and jdbc connection pool
concept is coming under type-3 ok so don't use jdbc term
separately rather than use type-1 or type-2 or type-4 and my
recommendation is to work with type-4 driver only.
Before going to advantage and disadvantage first what is
conncetion pool?
connection pool is a pool which contains set of readyily
available conncetion objects which can provide service to
more number of clients using less number of conncetion
object.e.g. think about our college , what happens here.
each student occupies chair to seat provided by
administratator , if administrator tells each student to
bring his own chair than what will happen just think and
compare it exactly with Direct connection object ok.
now come to chairs provided by administrator i mean they
think that each session will contain 100 students and
providing 100 chairs at a time and providing service to more
than 100 students.how, each session will contain 100
students so how many sessions can be conducted per day .now,
just imagine how connection pool is compatible with given
example.
Advantage
---------
->Advantage what i have given above not only that programmer
should think it is burden of creating , managing ,destroying
conncetion object , each task responisbility will be taken
care by connection pool
Disadvantage
------------
->I hope you will not get any disadvantage from connection pool
for more information call 9989683928 , i belong to hyd