读书人

ssh 运用proxool连接池

发布时间: 2012-10-24 14:15:58 作者: rapoo

ssh 使用proxool连接池
最近做了个绩效系统 使用了proxool连接池技术 连接用到的连接文件 proxool.xml 放在src目录下
内容 连接的为oracle10g


<something-else-entirely><proxool><alias>perevaDB</alias><driver-url>jdbc:oracle:thin:@localhost:1521:SID</driver-url><driver-class>oracle.jdbc.OracleDriver</driver-class><driver-properties><property name="user" value="username"/><property name="password" value="passowrd" /></driver-properties><house-keeping-sleep-time>9000</house-keeping-sleep-time>    <proxool.simultaneous-build-throttle>50</proxool.simultaneous-build-throttle><prototype-count>5</prototype-count><maximum-connection-count>100</maximum-connection-count><minimum-connection-count>10</minimum-connection-count><house-keeping-test-sql>select CURDATE()</house-keeping-test-sql>   </proxool></something-else-entirely>



spring配置文件 读取proxool.xml文件
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:aop="http://www.springframework.org/schema/aop"xmlns:tx="http://www.springframework.org/schema/tx"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsdhttp://www.springframework.org/schema/aop  http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx  http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"><!-- 声明一个 会话工厂配置属性 自动获得会话--><bean id="sessionFactory"/></property></bean><!-- 声明式事务管理  只对包含sav updat edit del add的方法用事务控制--><tx:advice id="txAdvice" transaction-manager="transactionManager"><tx:attributes><tx:method name="sav*" propagation="REQUIRED" timeout="30" /><tx:method name="updat*" propagation="REQUIRED" timeout="30" /><tx:method name="edit*" propagation="REQUIRED" timeout="30" /><tx:method name="del*" propagation="REQUIRED" timeout="30" /><tx:method name="add*" propagation="REQUIRED" timeout="30" /><tx:method name="RowsLogin*" propagation="REQUIRED" timeout="30" /></tx:attributes></tx:advice><aop:config><aop:pointcut id="CommonDAOpoint"expression="execution(* com.service.inter.*.*(..))" /><aop:advisor advice-ref="txAdvice"pointcut-ref="CommonDAOpoint" /></aop:config></beans>



另外在项目中需要导入两个连接池需要的文件

读书人网 >编程

热点推荐