commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brett Porter <bpor...@f2network.com.au>
Subject RE: [DBCP 1.1] DataSource.getConnection(usr, pwd): Cannot create Pool ableConnectionFactory
Date Wed, 03 Dec 2003 21:57:47 GMT
> 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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message