This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Dynamic Dependency Injection in Spring

 
Sunil Baboo
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic