To use Hibernate your application must have a Hibernate configuration file that contains the database connection details enabling the application to connect to a database. The file also contains information about the location of Hibernate mapping files. You can edit this file if you need to change the database connection details. You can have multiple Hibernate configuration files, but the default name for the configuration file used by Hibernate is hibernate.cfg.xml.
A Hibernate configuration file is created automatically if you create a web application and you select the Hibernate framework in the New Project wizard.
You can also create a Hibernate configuration file using the New File wizard if you want to use Hibernate in your application, for example in a Java SE application.
To create hibernate.cfg.xml using the New File wizard:
When you click Finish, the file hibernate.cfg.xml is created in the location you specified and the file opens in the Source Editor. If you did not specify a location the file is created in a source package with the name <default package>. The wizard also adds the Hibernate library to the classpath if it has not already been added.