• RubyonRails
  • PHP
  • SQL Tutorial
  • Spring
  • Core Java
  • JavaScript
  • jQuery
  • Struts

  • <


    Configuration, Generally written in hibernate.properties or hibernate.cfg.xml files. For Java configuration, you may find class annotated with @Configuration. It is used by Session Factory to work with Java Application and the Database. It represents an entire set of mappings of an application Java Types to an SQL database.

    Hibernate Properties
  • hibernate.dialect: This property makes Hibernate generate the appropriate SQL for the chosen database.
  • hibernate.connection.driver_class: The JDBC driver class.
  • hibernate.connection.url: The JDBC URL to the database instance.
  • hibernate.connection.username: The database username.
  • hibernate.connection.password: The database password.
  • hibernate.connection.pool_size: Limits the number of connections waiting in the Hibernate database connection pool.
  • hibernate.connection.autocommit: Allows autocommit mode to be used for the JDBC con

  • Example

    <?xml version = "1.0" encoding = "utf-8"?>
    <!DOCTYPE hibernate-configuration SYSTEM

    <property name = "hibernate.dialect">

    <property name = "hibernate.connection.driver_class">

    <!-- Assume test is the database name -->

    <property name = "hibernate.connection.url">

    <property name = "hibernate.connection.username">

    <property name = "hibernate.connection.password">

    <!-- List of XML mapping files -->
    <mapping resource = "Employee.hbm.xml"/>


    © copyright 2017-2021 Completedone pvt ltd.