/**
Author: willpower
Source: rifoo Technology (http://www.rifoo.com)
Date: 2006-06
Remarks: Reprinted please keep the above statement
**/
Today, let's take a look at the hibernate configuration file. There are two types: Property file and XML file.
Hibernate property File(Default hibernate. properties ):
1. You can configure JDBC connections.
2. If JDBC is managed by containers, such as WebLogic, you can specify the JNDI name here.
3. You can specify the SQL dialect to manage the SQL language between different databases (we will learn the SQL dialect later)
Xml configuration file(Hibernate. cfg. xml by default ):
1. You can configure the hibernate ing file.
2. You can configure the cache, listener, and JNDI name of sessionfactory.
3. Using hibernate. cfg. XML will overwrite the settings in hibernate. properties.
A simple example:
<? XML version = "1.0" encoding = "UTF-8"?>
<! Doctype hibernate-Configuration System
"[Url] http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd#/url]">
<Hibernate-configuration>
<Session-factory>
<Property name = "dialect"> org. hibernate. dialect. hsqldialect </property>
<Mapping jar = "hibernate-mappings.jar"/>
<Mapping Resource = "com/apress/hibernate/user. HBM. xml"/>
</Session-factory>
</Hibernate-configuration>