<!--标准的XML文件的起始行,version='1.0'表明XML的版本,encoding='gb2312'表明XML文件的编码方式--><wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> <?xmlversion='1.0'encoding='gb2312'?><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<!--表明解析本XML文件的DTD文档位置,DTD是Document Type Definition的缩写,即文档类型的定义,XML解析器使用DTD文档来检查XML文件的合法性。hibernate.sourceforge.net/hibernate-configuration-3.0dtd可以在Hibernate3.1.3软件包中的src\org\hibernate目录中找到此文件--><wbr></wbr>
<!DOCTYPE hibernate-configurationPUBLIC<wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> "-//Hibernate/HibernateConfiguration DTD 3.0//EN"<wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr>"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><!--声明Hibernate配置文件的开始--><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><hibernate-configuration><wbr></wbr></wbr></wbr>
<wbr><wbr><!--表明以下的配置是针对session-factory配置的,SessionFactory是Hibernate中的一个类,这个类主要负责保存HIbernate的配置信息,以及对Session的操作--><wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><session-factory><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><!--配置数据库的驱动程序,Hibernate在连接数据库时,需要用到数据库的驱动程序--><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><!--设置数据库的连接url:jdbc:mysql://localhost/hibernate,其中localhost表示mysql服务器名称,此处为本机,<wbr><wbr>hibernate是数据库名--><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><propertyname="hibernate.connection.url">jdbc:mysql://localhost/hibernate</hibernate><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><!--连接数据库是用户名--><wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.username">root</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><!--连接数据库是密码--><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.password">123456</property><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><!--数据库连接池的大小--><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.pool.size">20</property><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--是否在后台显示Hibernate用到的SQL语句,开发时设置为true,便于差错,程序运行时可以在Eclipse的控制台显示Hibernate的执行Sql语句。项目部署后可以设置为false,提高运行效率--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="hibernate.show_sql">true</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.fetch_size是指Hibernate每次从数据库中取出并放到JDBC的Statement中的记录条数。FetchSize设的越大,读数据库的次数越少,速度越快,FetchSize越小,读数据库的次数越多,速度越慢--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.fetch_size">50</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.batch_size是指Hibernate批量插入,删除和更新时每次操作的记录数。BatchSize越大,批量操作的向数据库发送Sql的次数越少,速度就越快,同样耗用内存就越大--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.batch_size">23</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.use_scrollable_resultset是否允许Hibernate用JDBC的可滚动的结果集。对分页的结果集。对分页时的设置非常有帮助--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.use_scrollable_resultset">false</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--connection.useUnicode连接数据库时是否使用Unicode编码--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="Connection.useUnicode">true</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--connection.characterEncoding连接数据库时数据的传输字符集编码方式,最好设置为gbk,用gb2312有的字符不全--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propertyname="connection.characterEncoding">gbk</property><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <!--hibernate.dialect只是Hibernate使用的数据库方言,就是要用Hibernate连接那种类型的数据库服务器。--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--指定映射文件为“hibernate/ch1/UserInfo.hbm.xml”--><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <mappingresource="org/mxg/UserInfo.hbm.xml"/><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr></session-factory><wbr></wbr></wbr>
<wbr></hibernate-configuration><wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr> <beanid="dataSource"<wbr><wbr></wbr></wbr></wbr>
<wbr>class="org.apache.commons.dbcp.BasicDataSource"<wbr><wbr></wbr></wbr></wbr>
<wbr>destroy-method="close"><wbr><wbr></wbr></wbr></wbr>
//连接驱动<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="driverClassName"value="${jdbc.driverClassName}"/><wbr><wbr></wbr></wbr></wbr>
//连接url,<wbr><wbr><wbr></wbr></wbr></wbr>
<property name="url" value="${jdbc.url}"/><wbr><wbr></wbr></wbr>
//连接用户名<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="username"value="${jdbc.username}"/><wbr><wbr></wbr></wbr></wbr>
//连接密码<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="password"value="${jdbc.password}"/><wbr><wbr></wbr></wbr></wbr>
</bean><wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<beanid="hbSessionFactory"<wbr><wbr></wbr></wbr>
<wbr>class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactory<wbr>Bean"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <property name="dataSource"ref="dataSource"/><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="configLocation"><wbr><wbr></wbr></wbr></wbr>
//hibernate配置文件位置<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr><value>WEB-INF/hibernate.cfg.xml</value><wbr><wbr></wbr></wbr></wbr>
<wbr></property><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="configurationClass"<wbr><wbr></wbr></wbr></wbr>
<wbr>value="org.hibernate.cfg.AnnotationConfiguration"/><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="hibernateProperties"><wbr><wbr></wbr></wbr></wbr>
<wbr><props><wbr><wbr></wbr></wbr></wbr>
<wbr>//针对oracle数据库的方言,特定的关系数据库生成优化的SQL<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dialect"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>org.hibernate.dialect.OracleDialect<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> //选择HQL解析器的实现<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.query.factory_class"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>org.hibernate.hql.ast.ASTQueryTranslatorFactor<wbr>y<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//是否在控制台打印sql语句<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.show_sql">true</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//在Hibernate系统参数中hibernate.use_outer_join被打开的情况下,该参数用来允许使用outerjoin来载入此集合的数据。<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.use_outer_join">true</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr>//默认打开,启用cglib反射优化。cglib是用来在Hibernate中动态生成PO字节码的,打开优化可以加快字节码构造的速度<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.cglib.use_reflection_optimizer">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> //输出格式化后的sql,更方便查看<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.format_sql">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr>//“useUnicode”和“characterEncoding”决定了它是否在客户端和服务器端传输过程中进行Encode,以及如何进行Encode<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.connection.useUnicode">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> //允许查询缓存, 个别查询仍然需要被设置为可缓存的.<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.cache.use_query_cache">false</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.default_batch_fetch_size">16</prop><wbr><wbr></wbr></wbr></wbr>
<wbr><wbr>//连接池的最大活动个数<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxActive">100</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> //当连接池中的连接已经被耗尽的时候,DBCP将怎样处理(0 = 失败,1 =等待,2<wbr> =<wbr> 增长)<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.whenExhaustedAction">1</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> //最大等待时间<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxWait">1200</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//没有人用连接的时候,最大闲置的连接个数<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxIdle">10</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> ##以下是对preparedstatement的处理,同上。<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxActive">100</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.whenExhaustedAction">1</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxWait">1200</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxIdle">10</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr></props><wbr><wbr></wbr></wbr></wbr>
<wbr></property><wbr><wbr></wbr></wbr></wbr>
</bean><wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><wbr><wbr> <?xmlversion='1.0'encoding='gb2312'?><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<!--表明解析本XML文件的DTD文档位置,DTD是Document Type Definition的缩写,即文档类型的定义,XML解析器使用DTD文档来检查XML文件的合法性。hibernate.sourceforge.net/hibernate-configuration-3.0dtd可以在Hibernate3.1.3软件包中的src\org\hibernate目录中找到此文件--><wbr></wbr>
<!DOCTYPE hibernate-configurationPUBLIC<wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> "-//Hibernate/HibernateConfiguration DTD 3.0//EN"<wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr>"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><!--声明Hibernate配置文件的开始--><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><hibernate-configuration><wbr></wbr></wbr></wbr>
<wbr><wbr><!--表明以下的配置是针对session-factory配置的,SessionFactory是Hibernate中的一个类,这个类主要负责保存HIbernate的配置信息,以及对Session的操作--><wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><session-factory><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><!--配置数据库的驱动程序,Hibernate在连接数据库时,需要用到数据库的驱动程序--><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><!--设置数据库的连接url:jdbc:mysql://localhost/hibernate,其中localhost表示mysql服务器名称,此处为本机,<wbr><wbr>hibernate是数据库名--><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><wbr><propertyname="hibernate.connection.url">jdbc:mysql://localhost/hibernate</hibernate><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><!--连接数据库是用户名--><wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.username">root</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><!--连接数据库是密码--><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.password">123456</property><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr><!--数据库连接池的大小--><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.connection.pool.size">20</property><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--是否在后台显示Hibernate用到的SQL语句,开发时设置为true,便于差错,程序运行时可以在Eclipse的控制台显示Hibernate的执行Sql语句。项目部署后可以设置为false,提高运行效率--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="hibernate.show_sql">true</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.fetch_size是指Hibernate每次从数据库中取出并放到JDBC的Statement中的记录条数。FetchSize设的越大,读数据库的次数越少,速度越快,FetchSize越小,读数据库的次数越多,速度越慢--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.fetch_size">50</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.batch_size是指Hibernate批量插入,删除和更新时每次操作的记录数。BatchSize越大,批量操作的向数据库发送Sql的次数越少,速度就越快,同样耗用内存就越大--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.batch_size">23</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--jdbc.use_scrollable_resultset是否允许Hibernate用JDBC的可滚动的结果集。对分页的结果集。对分页时的设置非常有帮助--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="jdbc.use_scrollable_resultset">false</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--connection.useUnicode连接数据库时是否使用Unicode编码--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <propertyname="Connection.useUnicode">true</property><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--connection.characterEncoding连接数据库时数据的传输字符集编码方式,最好设置为gbk,用gb2312有的字符不全--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propertyname="connection.characterEncoding">gbk</property><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr> <!--hibernate.dialect只是Hibernate使用的数据库方言,就是要用Hibernate连接那种类型的数据库服务器。--><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <propertyname="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><!--指定映射文件为“hibernate/ch1/UserInfo.hbm.xml”--><wbr><wbr><wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr><wbr><wbr><wbr> <mappingresource="org/mxg/UserInfo.hbm.xml"/><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr></session-factory><wbr></wbr></wbr>
<wbr></hibernate-configuration><wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<wbr> <beanid="dataSource"<wbr><wbr></wbr></wbr></wbr>
<wbr>class="org.apache.commons.dbcp.BasicDataSource"<wbr><wbr></wbr></wbr></wbr>
<wbr>destroy-method="close"><wbr><wbr></wbr></wbr></wbr>
//连接驱动<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="driverClassName"value="${jdbc.driverClassName}"/><wbr><wbr></wbr></wbr></wbr>
//连接url,<wbr><wbr><wbr></wbr></wbr></wbr>
<property name="url" value="${jdbc.url}"/><wbr><wbr></wbr></wbr>
//连接用户名<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="username"value="${jdbc.username}"/><wbr><wbr></wbr></wbr></wbr>
//连接密码<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr> <property name="password"value="${jdbc.password}"/><wbr><wbr></wbr></wbr></wbr>
</bean><wbr><wbr></wbr></wbr>
<wbr><wbr></wbr></wbr>
<beanid="hbSessionFactory"<wbr><wbr></wbr></wbr>
<wbr>class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactory<wbr>Bean"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <property name="dataSource"ref="dataSource"/><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="configLocation"><wbr><wbr></wbr></wbr></wbr>
//hibernate配置文件位置<wbr><wbr><wbr></wbr></wbr></wbr>
<wbr><value>WEB-INF/hibernate.cfg.xml</value><wbr><wbr></wbr></wbr></wbr>
<wbr></property><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="configurationClass"<wbr><wbr></wbr></wbr></wbr>
<wbr>value="org.hibernate.cfg.AnnotationConfiguration"/><wbr><wbr></wbr></wbr></wbr>
<wbr> <propertyname="hibernateProperties"><wbr><wbr></wbr></wbr></wbr>
<wbr><props><wbr><wbr></wbr></wbr></wbr>
<wbr>//针对oracle数据库的方言,特定的关系数据库生成优化的SQL<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dialect"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>org.hibernate.dialect.OracleDialect<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> //选择HQL解析器的实现<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.query.factory_class"><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>org.hibernate.hql.ast.ASTQueryTranslatorFactor<wbr>y<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr></prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//是否在控制台打印sql语句<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.show_sql">true</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//在Hibernate系统参数中hibernate.use_outer_join被打开的情况下,该参数用来允许使用outerjoin来载入此集合的数据。<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.use_outer_join">true</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr>//默认打开,启用cglib反射优化。cglib是用来在Hibernate中动态生成PO字节码的,打开优化可以加快字节码构造的速度<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.cglib.use_reflection_optimizer">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> //输出格式化后的sql,更方便查看<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.format_sql">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr>//“useUnicode”和“characterEncoding”决定了它是否在客户端和服务器端传输过程中进行Encode,以及如何进行Encode<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.connection.useUnicode">true</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> //允许查询缓存, 个别查询仍然需要被设置为可缓存的.<wbr><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.cache.use_query_cache">false</prop><wbr><wbr></wbr></wbr></wbr>
<wbr> <propkey="hibernate.default_batch_fetch_size">16</prop><wbr><wbr></wbr></wbr></wbr>
<wbr><wbr>//连接池的最大活动个数<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxActive">100</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr> //当连接池中的连接已经被耗尽的时候,DBCP将怎样处理(0 = 失败,1 =等待,2<wbr> =<wbr> 增长)<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.whenExhaustedAction">1</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> //最大等待时间<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxWait">1200</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr>//没有人用连接的时候,最大闲置的连接个数<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.maxIdle">10</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> ##以下是对preparedstatement的处理,同上。<wbr><wbr><wbr></wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxActive">100</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.whenExhaustedAction">1</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxWait">1200</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr><wbr> <propkey="hibernate.dbcp.ps.maxIdle">10</prop><wbr><wbr></wbr></wbr></wbr></wbr>
<wbr></props><wbr><wbr></wbr></wbr></wbr>
<wbr></property><wbr><wbr></wbr></wbr></wbr>
</bean><wbr></wbr>