You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Brett Porter <bp...@f2network.com.au> on 2003/12/03 22:57:47 UTC

RE: [DBCP 1.1] DataSource.getConnection(usr, pwd): Cannot create Pool ableConnectionFactory

> If you really want to use this method then you can use 
> PerUserPoolDataSource 
> or SharedPoolDataSource. 
> http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/comm
> ons/dbcp/datasources/package-summary.html
> 
> If the unencrypted password in server.xml is the main problem 
> then you can 
> also subclass BasicDataSourceFactory and add some code to fix 
> your issue.
> 
> You can then encrypt the password or load the password from 
> another source. The tomcat start script could ask for a 
> password, store it in a temp file, the 
> factory would read the file (and after tomcat is started the 
> script would 
> delete the password file).
> 
> If you choose this last option then I'm interested in your 
> solution (to put on 
> the site as an example).

We use the sharedpooldatasource, initially configured with a low-permission
username/password that is used to test connections.

We then connect later using a username an password, with the password being
read from a JCE keystore. I think this is a better solution that to muck
around with BasicDataSource.

However, it should be noted that sharedpooldatasourcefactory doesn't work at
all in the 1.1 release if you have more than one factory (ie need to be
connecting to two different databases in one app). A patch is in bugzilla.

Cheers,
Brett