commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eugene Droi <ed...@cbnco.com>
Subject DataSource.getConnection(userName, password)
Date Wed, 14 May 2003 14:34:23 GMT
Hi guys,

Is there any particular reason why DataSource.getConnection(userName, 
password)
is not implemented. I don't like the idea of specifying username and 
password as open
text in my server.xml for security reasons, besides it limits my 
application to only one username and password
combination.
Currently I made a weird workaround like :
-----------------------------------------------------------------------------------------
            DataSource ds = (DataSource)envContext.lookup("jdbc/myoracle");
            ((BasicDataSource)ds).setUsername(userName);
            ((BasicDataSource)ds).setPassword(password);
            ((BasicDataSource)ds).setUrl(dbURL);
            connection = ds.getConnection();
-----------------------------------------------------------------------------------------
Connection pooling seems to work in such case, but I just wonder what I 
am missing here
and what prevented the DBCP developers to implement 
getConnection(userName, password) ?

Appreciate any help
Eugene


Mime
View raw message