java - Best practice to manage Apache Cayenne "...project.xml" file -


apache cayenne keeps "...project.xml" file within resources directory. file contains password database. problem because [deployment server] password should not visible developers. further, need different user/password , connection different database during development.

what best practice manage "...project.xml" when using cayenne? suggestions?

edit:

instead of putting database connection info (incl. password) xml file, is possible inject info programatically datasource object? if so, can load info config file when app starts , inject it.

yes of course. there "cayenne.jdbc.password" property can used define datasource password in runtime. can applied in 2 alternative ways:

  1. as system property on command line:

    java -dcayenne.jdbc.password=xxxxx

  2. via injection:

    servermodule.contributeproperties(binder) .put(constants.jdbc_password_property, "xxxxx");

this , other config properties documented here.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -