<! DOCTYPE hibernate-configuration Public
"-//hibernate/hibernate Configuration DTD 3.0//en"
"Http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd" >
<session-factory>
<!--hibernate dialect, used to determine the connected database--
<property name= "Hibernate.dialect" >
Org.hibernate.dialect.SQLServer2005Dialect <!--Select the database that corresponds to the database dialect---
</property>
<!--database Connection class--
<property name= "Hibernate.connection.driver_class" >
Com.microsoft.sqlserver.jdbc.SQLServerDriver <!--SQL Server Connection driver
</property>
<!--database connection string and user name password--
<property name= "Hibernate.connection.url" >
Jdbc:sqlserver://127.0.0.1:1433;databasename=db_test <!--SQL Server connection address--
</property>
<property name= "Hibernate.connection.username" >sa</property> <!--SQL Server connect user name--
<property name= "Hibernate.connection.password" >901030</property> <!--SQL Server connect user password--
<!--when using hibernate, the appropriate SQL--
<property name= "Show_sql" >true</property>
<!--do not format SQL statements--
<property name= "Hibernate.format_sql" >false</property>
<!--Specify a custom policy for the session--
<property name= "Hibernate.current_session_context_class" >thread</property>
<!--automatically complete the class-to-data table conversion--
<property name= "Hibernate.hbm2ddl.auto" >update</property>
<!--specify JDNI data Source--
<property name= "connection. Datasource ">java:comp/env/jdbc/test</property>
<!--c3p0 JDBC Connection pool--
<property name= "Hibernate.c3p0.max_size" >20</property>
<property name= "Hibernate.c3p0.min_size" >5</property>
<property name= "Hibernate.c3p0.timeout" >120</property>
<property name= "Hibernate.c3p0.max_statements" >100</property>
<property name= "Hibernate.c3p0.idle_test_period" >120</property>
<property name= "Hibernate.c3p0.acquire_increment" >2</property>
<property name= "Hibernate.c3p0.validate" >true</property>
<!--map Files--
<!--<mapping resource= "Userdemo.hbm.xml"/>--> Mapping entity class configuration files
<mapping resource= "Fooddemo.hbm.xml"/>
<mapping resource= "Orderdemo.hbm.xml"/>
</session-factory>
Hibernate configuration file