Want to clear some confusion. I have applicationContext.xml.
Question 1: Whats the difference between 1 & 2. Are they both same with different a
If what you want is to build a session factory, you will get the same result with both approaches. I don't think one can do more than the other.
In my opinion, you would use the hibernate.cfg.xml approach when you are not using Spring. When JUnit testing your DAOs for example. Not having to build a Spring application context makes your tests run faster.
However, when you are using Spring, I think it's a good thing to keep your datasource separated from the session factory. You are using Spring for dependency inject, right? Why not using spring to give your session factory what it needs?