This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to control the number of initial connection when creating a connection pool (Apache-Postgres). I require 1-2 connections but i am initially receiving 4. I see that in BasicDataSource i can set the initialSize of the pool, however i do not understand how to set initialSize using PoolingDataSource.
Originally posted by Robert Kennedy: Thank you for your response. What I require is a mean to set the connection size (initialSize) using Java directly, not a configuration document.
BasicDataSource allows you to create connection pool without xml config file. It has setters for the settings you would otherwise put in the config file. BasicDataSource.setInitialSize(). Read the note in the javadoc: you have to call this method early.