permaculture playing cards
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

Dynamic Dependency Injection in Spring

Sunil Baboo

Joined: Aug 12, 2010
Posts: 16

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

Dao Class

For Vertica Dao Class

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.
I agree. Here's the link:
subject: Dynamic Dependency Injection in Spring
It's not a secret anymore!