There are two configuration files in Hibernate by which we can configure the DB connection .One is xml configuration file (name Hibernate.cfg.xml) and other one is properties file (name hibernate.properties) .
Which configuration file should use ? Which one is the better approach ?
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.
Even hibernate documentation recommends to keep both types of file in your class path.
Joined: Jun 03, 2009
Thanks Subramani for the reply .
As per my understanding the properties file is the better approach , because its more user friendly and it support some default values as well.
Please correct me if am wrong .....