BasicDataSource delegates the getConnection method calls to a PoolingDataSource and therefor doesn't support the getConnection(String username, String password) method call.

If you really want to use this method then you can use PerUserPoolDataSource or SharedPoolDataSource.
http://jakarta.apache.org/commons/dbcp/apidocs/org/apache/commons/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).

-- Dirk


[EMAIL PROTECTED] wrote:


The method BasicDataSource.getConnection(String username, String password)
is now implemented, but using it (from Tomcat 4.1.29, DBCP 1.1, Pools 1.1)
raises an SQLException. The JDBC driver complains about not having got the
user credentials. Seems like username and password aren't passed internally
(or have I done anything wrong?).


BTW: putting the credentials into Tomcat's server.xml and using
getConnection() works, but using getConnection(with params) throws an
UnsupportedException in PoolingDataSource.getConnection().

Any workaround? I need to provide the credentials at runtime to avoid
storing them in the server.xml (unencrypted!).

Thanks for any help!


Michael Bellinger




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to