Re: Supplying a JDBC password at run-time.

2019-12-03 Thread randygalbraith
Hi Jon, You make mention of this, but probably good to emphasize this point... The code I posted is proof-of-concept work and it contains a rather glaring security issue. That is: System.err.println("definition=["+definition+"]"); dumps the plaintext password to stderr, which in my case is logs/

Re: Supplying a JDBC password at run-time.

2019-12-03 Thread randygalbraith
Hi Dmitry & Richard, Thank you for all your help! Here is my anonymized source for what worked :-) DataSourceFactory.java: package path1.path2; import java.io.IOException; import path3.path4.FooStore; public class DataSourceFactory { public Object create() { String password = nu

Re: Supplying a JDBC password at run-time.

2019-12-03 Thread randygalbraith
Hi Richard, I was reading that document (among others). In the "Defining Resources" section it shows this code: p.setProperty("DB.Password", "password"); This is close to what I need to work. Alas, the example does not show how the variable "p" is created. Thus I was on the hunt to understand pr

RE: Supplying a JDBC password at run-time.

2019-12-02 Thread randygalbraith
Hi Dimtry, I hope to work on this again tomorrow. The idea of creating a custom DataSourceFactory seems like the way to go. This approach does raise the question about where to store the elements other than the password. For example the UserName= will need to be variable on a per-environment basis

RE: Supplying a JDBC password at run-time.

2019-12-02 Thread randygalbraith
Hi Dmitry, Interesting. I did not know ${} syntax within resources.xml would pull in values from the environment. Alas, that would not work in my case, since our Oracle password is not and cannot be an environment variable. Cheers, -Randy -- Sent from: http://tomee-openejb.979440.n4.nabble.com

Supplying a JDBC password at run-time.

2019-12-02 Thread randygalbraith
I am looking for advice on the best way to supply an Oracle password at run-time. When our application connects to Oracle it uses a password that is provided from a password store. The password itself is updated every 60 days. My current WEB-INF/resources.xml looks like this: JdbcDrive