hibernate 配置proxool连接池

     把我一直用的proxool连接池拿出来晒晒,呵呵。

    下面是hibernate配置文件的代码:

<?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="hibernate.proxool.pool_alias">
			javawindPool2
		</property>
		<property name="hibernate.proxool.xml">
			proxoolconf.xml
		</property>
		<property name="hibernate.connection.driver_class">
			org.hibernate.connection.ProxoolConnectionProvider
		</property>
		<property name="hibernate.connection.release_mode">
			auto
		</property>
		<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
		<property name="connection.autocommit">true</property>
		<!--你的表映射-->
		<mapping resource="com/***.hbm.xml" />
	</session-factory>
</hibernate-configuration>

 下面是proxool连接池的配置文件:

<?xml version="1.0" encoding="utf-8"?>
<something-else-entirely>
 <proxool>
  <alias>javawindPool2</alias>
  <driver-url>jdbc:mysql://localhost:3306/aa?autoReconnect=true&amp;useUnicode=true&amp;characterEncoding=UTF-8</driver-url>
  <driver-class>com.mysql.jdbc.Driver</driver-class>
  <driver-properties>
   <property name="user" value=""/>
   <property name="password" value=""/>
  </driver-properties>
  <house-keeping-sleep-time>90000</house-keeping-sleep-time>
  <prototype-count>1</prototype-count>
  <maximum-new-connections>20</maximum-new-connections> 
  <maximum-connection-count>1000</maximum-connection-count>
  <minimum-connection-count>20</minimum-connection-count>
  <maximum-active-time>60</maximum-active-time>
  <simultaneous-build-throttle>500</simultaneous-build-throttle>
  <house-keeping-test-sql>select CURRENT_DATE</house-keeping-test-sql>
 </proxool>
</something-else-entirely>

 附件中是proxool jar,还有对应版本的hibernate jar。

你可能感兴趣的:(mysql,xml,Hibernate,MyEclipse,prototype)