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:
as system property on command line:
java -dcayenne.jdbc.password=xxxxx
via injection:
servermodule.contributeproperties(binder) .put(constants.jdbc_password_property, "xxxxx");
this , other config properties documented here.
Comments
Post a Comment