<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://10.51.11.67:3306/DBRCS?useUnicode=true&characterEncoding=UTF-8</property>
<property name="hibernate.connection.username">DBRCS_root</property>
<property name="hibernate.connection.password">123</property>
<property name="hibernate.show_sql">true</property>
<!-- 配置C3P0连接池属性 -->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<!-- 最大连接数 -->
<property name="hibernate.c3p0.max_size">20</property>
<!-- 最小连接数 -->
<property name="hibernate.c3p0.min_size">5</property>
<!-- 获得连接的超时时间,如果超过这个时间,会抛出异常,单位毫秒 -->
<property name="hibernate.c3p0.timeout">5000</property>
<!-- 最大的PreparedStatement的数量 -->
<property name="hibernate.c3p0.max_statements">20</property>
<!-- 每隔120秒检查连接池里的空闲连接 ,单位是秒 -->
<property name="hibernate.c3p0.idle_test_period">120</property>
<!-- 当连接池里面的连接用完的时候,C3P0一下获取的新的连接数 -->
<property name="hibernate.c3p0.acquire_increment">2</property>
<!-- 每次都验证连接是否可用 -->
<property name="hibernate.c3p0.validate">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<!-- 配置映射文件 com.archermind.domain -->
<mapping resource="com/archermind/domain/Blacklist.hbm.xml" />
<mapping resource="com/archermind/domain/Area.hbm.xml" />
<mapping resource="com/archermind/domain/User.hbm.xml" />
<mapping resource="com/archermind/domain/Suggestion.hbm.xml" />
<mapping resource="com/archermind/domain/News.hbm.xml" />
<mapping resource="com/archermind/domain/Version.hbm.xml" />
<mapping resource="com/archermind/domain/WhiteList.hbm.xml" />
<mapping resource="com/archermind/domain/Faq.hbm.xml" />
<mapping resource="com/archermind/domain/SysConfig.hbm.xml" />
</session-factory>
</hibernate-configuration>
以上是数据库的配置,以及连接池的配置,hibernate映射文件,数据库为mysql