'How to configure multiple database interchangeably in springboot means at a time 1 will be active but that will be decided based on the configuration

I have written one base interface and 4 implementation class and configuration class is creating beans using Conditionalonproperty annotation but I am not able to initialize the interface in the controller class. And how the respective class will be chosen at runtime.Please suggest.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source