properties - Change application.conf runtime? -



properties - Change application.conf runtime? -

i want set database connection @ run time play project. know can set property run time next code:

@onapplicationstart public class bootstrap extends job { @override public void dojob() { // set values in properties file play.configuration.setproperty("db.driver", dbdriver); play.configuration.setproperty("db.url", dburl); play.configuration.setproperty("db.user", dbusername); play.configuration.setproperty("db.pass", dbpassword); } }

but when executing code above file not changed, think in memory.

how can set database properties , forcefulness play! utilize properties in order connect right database onapplicationstart?

thanks!

update 2012-01-29

solution possible via plugin. in plugin have override onconfigurationread() , apply properties configuration file @ moment. seek post code have time this.

by time alter properties, db plugin initialized. need write plugin , overwrite onconfigurationread() method, set new settings there. paly's dbplugin init later on.

properties playframework

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -