3

I've read that I can set bean initialization properties in .properties file. I can do that with help of PropertyBeanPlaceholderConfigurer.

I want to do the same, but pull bean initialization properties from DB instead.

  1. Have Spring got a standart realization for factory post processor which will help me to pull initialization properties from DB? Which?
  2. If haven't, how can I realizate it?
VB_
  • 45,112
  • 42
  • 145
  • 293
  • 2
    possible duplicate of [PropertyPlaceholderConfigurer to look for DB values and use properties file as fallback](http://stackoverflow.com/questions/18098140/propertyplaceholderconfigurer-to-look-for-db-values-and-use-properties-file-as-f) – venergiac Jan 14 '14 at 21:56
  • 1
    Seems to be done easily using JavaConfig; see [this answer](http://stackoverflow.com/a/11161604/491897) for details – Ben Siver Jan 14 '14 at 22:39
  • @BenS thanks. But if I don't want to rewrite the whole application config for single bean initialization. – VB_ Jan 15 '14 at 07:18
  • I 've found the answer through the reference pointed above: http://pure-essence.net/2011/02/10/spring-loading-properties-from-database-with-a-twist/ – VB_ Jan 15 '14 at 07:27
  • 1
    You wouldn't need to rewrite the entire application config. Java config is used in addition to any existing xml config. – Ben Siver Jan 15 '14 at 15:00

0 Answers0