> 1. Is this feature not supported ? Correct. getConnection(username,password) is not supported by the BasicDataSource. BasicDataSource contains one pool of connections, and doesn't support different username/password combinations within that pool.
> 2. Is there another way of doing this ? With BasicDataSource, I suppose you could have a distinct pool (datasource) for each username/password pair you're interested in. You could also use Jdbc2PoolDataSource (see below). > 3. If this feature is not supported right now, is it proposed to be > supported in the future ? I don't know of any specific plans to support this in BasicDataSource, but that doesn't rule it out. I think that the JDBC2Pool that John and some others put together supports this already. The binaries are available in the nightly builds (only, there is no release containing it yet). See: http://nagoya.apache.org/gump/javadoc/jakarta-commons/dbcp/dist/docs/api/org /apache/commons/dbcp/jdbc2pool/package-summary.html and: http://nagoya.apache.org/gump/javadoc/jakarta-commons/dbcp/dist/docs/api/org /apache/commons/dbcp/jdbc2pool/Jdbc2PoolDataSource.html for some documentation (including how to configure this as a JNDI datasource within Tomcat). See: http://cvs.apache.org/viewcvs/jakarta-commons/dbcp/src/java/org/apache/commo ns/dbcp/jdbc2pool/ for the relevant bits of the source tree. See: http://jakarta.apache.org/builds/jakarta-commons/nightly/commons-dbcp/ for "nightly" source and binary drops. Perhaps one of the folks already using Jdbc2PoolDataSource could comment.
