Search code examples
weblogicconnection-poolingapache-commons-dbcp

Connection pooling on server vs application


What is difference between doing connection pooling settings in application code like shown in below link vs doing on the server itself like shown in the second link for weblogic?

  1. http://javarevisited.blogspot.com/2012/06/jdbc-database-connection-pool-in-spring.html

  2. https://docs.oracle.com/cd/E13222_01/wls/docs81/ConsoleHelp/jdbc_connection_pools.html#1106131

Can someone explain?

Thanks!


Solution

  • If you are a web application programmer just trying out new stuff you can do it either way. You can learn both ways if you want to.

    If you are setting up a company you may need more structure and separation of responsibilities:

    Some of the advantages of Server Connection Pooling are:

    • Security. The password for the production database can remain encrypted and unknown to the developer.
    • Separation of roles. The connection pool can be managed by a different group of people, let's say middleware admins, who may not know how to code.
    • Administration. Stopping, starting and other lifecycle events can be managed by non-developers.
    • Configuration. The pool can be fine-tuned by database admins or data analysts as needed.