I am trying to connect to DB in a servlet using Hibernate.I have read that we can use either hibernate.cfg.xml or hibernate.properties file for configuration of session.For me it worked with xml. Now when I am trying to use properties instead of xml its not working. It is saying that hibernate.cfg.xml not found.But nowhere I mentioned to use xml file and infact I have deleted that xml file.
Please Help me. And Please correct me if I am doing anything wrong.
From what i understood from hibernate the best thing to do is to define the mapping in the
hibernate.cfg.xml file and other configurations in the
An alternative approach to configuration is to specify a full configuration in a file named
hibernate.cfg.xml. This file can be used as a replacement for the
hibernate.properties file or, if both are present, to override properties.
hibernate.cfg.xml is also more convenient once you have to tune the Hibernate cache. It is your choice to use either hibernate.properties or
hibernate.cfg.xml. Both are equivalent.
You can read more about this in the following link: