1.

What can you tell about Hibernate Configuration File?

Answer»

Hibernate Configuration File or hibernate.cfg.xml is ONE of the most required configuration files in Hibernate. By default, this file is placed under the src/main/resource folder.
The file contains database related configurations and session-related configurations.
Hibernate facilitates PROVIDING the configuration either in an XML file (like hibernate.cfg.xml) or a properties file (like hibernate.properties).

This file is used to define the below information:

  • Database CONNECTION details: Driver class, URL, username, and password.
  • There MUST be one configuration file for each database used in the application, suppose if we want to connect with 2 databases, then we must create 2 configuration files with different names.
  • Hibernate properties: Dialect, show_sql, second_level_cache, and mapping file names.


Discussion

No Comment Found