wood burning stoves 2.0*
The moose likes Spring and the fly likes Dynamic Dependency Injection in Spring Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Dynamic Dependency Injection in Spring" Watch "Dynamic Dependency Injection in Spring" New topic
Author

Dynamic Dependency Injection in Spring

Sunil Baboo
Greenhorn

Joined: Aug 12, 2010
Posts: 16
Hi,

I am new to Spring DI.

Here is my situation, i have controller and its corresponding dao working in ORACLE DB. Now VERTICA DB has been introduced in application. Controller create new instance of dao. i.e
Controller Class
GRPController.java

Dao Class
GRPDaoOracle.java

For Vertica Dao Class
GRPDaoVertica.java

In controller there is written

public String getFootnote(){
return new GRPDaoOracle().getFooterSentence("02");
}

Can we dynamically inject dao based on chosen DB? How we can inject vertica dao or oracle dao based on chosen DB.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Dynamic Dependency Injection in Spring
 
Similar Threads
What to choose, daoFactory or a SpringUtil from ZK?
How to get VO object from Spring factory
Spring services + wbeflow actions
doubt on Objects created using Spring object factory and ones created inside class when using Spring
Mock Google Guice @Inject for JPA