which scenarios we go for jdbc,and which scenario we go for
connection polling and wat r advantages and disadvantages
using connection pooling.

Answers were Sorted based on User's Feedback



which scenarios we go for jdbc,and which scenario we go for connection polling and wat r advantage..

Answer / priyabrata patro

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

Is This Answer Correct ?    5 Yes 0 No

which scenarios we go for jdbc,and which scenario we go for connection polling and wat r advantage..

Answer / mukundan

First part of the question seems irrelevant as JDBC has to
be used to access RDB irrespective of whether Connection
pooling is used or not.

Advantage of creating and using connection pooling is to
share the number of connections to the database in an
organized and distributed ways when the same RDB is used by
multiple applications.

Using connection pooling is advantageous
(1) the application doesn't overshoot with the number of
connections available/allotted for the application
(2) creating connection with a RDB is a costly operation
where as this is done one time and a pool of connection is
created during the startup of the application
(3) Connections from the pool are readily available for use
and they are reused which is much faster as per (2) above

Disadvantages of Connection pooling:
(1) When multiple application uses a RDB, each application
grabs its share (the allotted number of connections) during
start-up irrespective of its usage of the grabbed
connections. For example, if one application grabs 100
connections up front and its peak usage is only 40 or 50
then they are strictly not available to any other
application who's peak usage may be more than their allocation.
(2) If connections are not released appropriately by the
applications then the performance of the systems could go
haywire.

Is This Answer Correct ?    4 Yes 0 No

Post New Answer

More JDBC Interview Questions

What is the feature of jdbc v4?

0 Answers  


What is ojdbc14 jar?

0 Answers  


Explain about column name and getter method?

0 Answers  


I have written a program to connect to database using odbc.Can this Application run on any Platform????

2 Answers  


What does Class.forName return?

8 Answers   IBM,






How can you sort dates?

1 Answers  


How many jdbc driver types are there?

0 Answers  


what happens if connection is not closed?

7 Answers   CTS,


What is database deadlock ?

0 Answers  


Give me some example for getting connection from connection pooling in JBoss Server. Is Connection Pool default in Server or we have to create it? Who can create Connection Pool in a Team. How it will be accessed by the developer code?

1 Answers   TCS,


What is an encrypted internet connection?

0 Answers  


Why “no suitable driver” error occurs?

0 Answers  


Categories