loading database from DB and injecting in autowired bean