Originally posted by Deepika Wadhwa:
1) is it database vendor specific or not ?
2) we can change setting for no of connection at a time thru web server or servlet container?
in my application I am using Apache web server with Tomcat.
Hi
In a nutshell, connection pooling is not (in ALL cases) dependant on the DB server you are using. To be able to interact with a connection pool for databases
you should look into the JNDI api , and the "Datasource" method of connection in javax.sql.*.
JNDI is a
java API that will allow you interact and manage diffrent kinds of resources (referred to as directories) such as printers, modems, file systems and even db connections. To do this you need some kind of 'service provider' to be the 'bind' between the LDAP/JNDI and your program. There are many diffrent service providers and some (most) are rolled into the
EJB application servers you may see us talking about here. Example would be Weblogic, Websphere, Jrun, (and even Resin) although resin is a servlet engine and not an application server.
IN a database world a service provider will allow you to setup and maintain collections or pools of database connections. Tomcat (as far as I know) currently has no connection pooling ability, but, you can go try out my favorite Servlet Engine at
http://www.caucho.com. The engine is called Resin and it allows you to do connection pooling quite easily. I also reccommend that you quickly look at the JNDI
doc at Sun when you have a chance
http://java.sun.com/jndi As for your second question, yes you can control how many connection are created and how long they live.
I hope this helps.