aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
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.
 
jQuery in Action, 2nd edition
 
subject: Dynamic Dependency Injection in Spring