File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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.
 
 
subject: Dynamic Dependency Injection in Spring