What is the use of configure() method in the Configuration class? Also what it means by saying Configuration cfg = new Configuration()? Please explain guys!
That is instantiating a new Configuration. A Configuration represents a set of mappings between object and database. The configure methods allow different way to define the Configuration, either by using Hibernate default lookup strategy (finding hibernate.cfg.xml in the classpath) or explicitly definig it some other way.