This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Problem Scenario:Putting dataSource from Persistence.xml and ApplicationContext.xml at one place.
I am having a tough time integrating Hibernate with Spring framework. I am following strict JPA guidelines in the framework. So I am having one persistence.xml and some orm.xml which basically contains the mapping. In my persistence.xml I am providing the dataSource as hibernate standards.Everything is working fine with this configuration:-
In my applicationContext.xml(Spring xml) I am doing
But the point is that I don't want to declare give my db details at two places. Putting all db details in application context makes more sense. So i tried integrating using sessionFactory bean concept provided at various sites but still have no success.
I am trying to all this new bean in my applicationContext.xml
Can you please provide me a good example how to put all my datasource at one place.