<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>
<session-factory>
<property name="dialect">
com.huawei.exam.util.LocalMysqlDialect
</property>
<property name="connection.driver_class">
com.mysql.jdbc.Driver
</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.ast.ASTQueryTranslatorFactory</property>
<property name="connection.url">jdbc:mysql://10.71.188.93:3306/test?useUnicode=true&characterEncoding=UTF-8</property>
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<property name="connection.username">root</property>
<!--<property name="connection.password">Eclipse$2012</property>-->
<property name="show_sql">false</property>
<!-- 配置连接池 -->
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<!-- 链接的最大空闲时间秒数 -->
<property name="hibernate.c3p0.timeout">50000</property>
<!--被缓存的预编译语句的最大数 JDBC的标准参数,用以控制数据源内加载的PreparedStatements数量。但由于预缓存的statements
属于单个connection而不是整个连接池。所以设置这个参数需要考虑到多方面的因素。
如果maxStatements与maxStatementsPerConnection均为0,则缓存被关闭。Default: 0-->
<property name="hibernate.c3p0.max_statements">100</property>
<!-- 链接自动生效前得空闲秒数 单位毫秒 -->
<property name="hibernate.c3p0.idle_test_period">1000</property>
<!--连接池中保留的最大连接数。Default: 15 -->
<property name="hibernate.c3p0.max_size">20</property>
<!--连接池中保留的最小连接数。Default: 15 -->
<property name="hibernate.c3p0.min_size">5</property>
<!-- 验证连接有效性 -->
<property name="hibernate.c3p0.validate">true</property>
<!--每60秒检查所有连接池中的空闲连接。Default: 0 -->
<property name="idleConnectionTestPeriod">0</property>
<property name="maxIdleTime">5</property>
<property name="maxConnectionAge">30</property>
<!--定义在从数据库获取新连接失败后重复尝试的次数。Default: 30 -->
<property name="acquireRetryAttempts">10</property>
<!--两次连接中间隔时间,单位毫秒。Default: 1000 -->
<property name="acquireRetryDelay">1000</property>
<!-- 配置映射关系 -->
</session-factory>
</hibernate-configuration>