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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dynamic Dependency Injection in Spring
 
Similar Threads
How to get VO object from Spring factory
Spring services + wbeflow actions
Mock Google Guice @Inject for JPA
What to choose, daoFactory or a SpringUtil from ZK?
doubt on Objects created using Spring object factory and ones created inside class when using Spring