farzad wrote:
Why do you need to make is so complicate? If I understand correctly you just need to keep your password away from your version control repository. In that case just store passwords locally and have ant replace it for you at the build time.
Farzad-
I can't deploy the password either - our production directories are again visible to many people. We have a secure mechanism for obtaining passwords from shell scripts and typically pass the usernames/passwords as environment variables into our program on invocation from autosys (all this is batch program by-the-way).
Slightly off topic but passwords are not the only things we might want to change. e.g. I write a lot of configuratable arguments to the scripts (using getopts) that provide target database servers (dev, test, qa, prod), logging level, target email notifications etc. We use spring and bind parameters to defer configuration options to allow use to alter application behaviour as needed, and we can use a single Spring application config file. I am essentially looking for the same pattern with Hibernate (for example I might want to switch off sql logging to focus on other activity).
Passwords is the most import however. Our environment as I say is (intentionally) open, so security around passwords is tightly controlled through the use of production IDs, so we need to be able to defer using passwords till the very last moment.
If we can configure a data source in java then 'inject' this into hibernate that would be the most ideal solution for us - hence the reason for this thread.
I'm not trying to over-complicate, if anything I want to avoid using application servers and other heavyweight approaches, but I still want the flexibility of allowing config from the command line, combined with the efficiencies of using Hibernate.