Spring中C3P0数据源的配置
来源:互联网 发布:js中的引用类型 编辑:程序博客网 时间:2024/05/22 11:31
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"><!-- 配置c3p0数据源 --><bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"destroy-method="close"><!-- 数据库驱动 --><property name="driverClass" value="com.mysql.jdbc.Driver" /><!-- 数据库连接串 --><property name="jdbcUrl" value="jdbc:mysql://localhost/hiber" /><!-- 数据库用户 --><property name="user" value="root" /><!-- 数据库密码 --><property name="password" value="root" /><!-- 最小连接数 --><property name="minPoolSize" value="10" /><!-- 最大连接数 --><property name="maxPoolSize" value="20" /><!-- 最大空闲的时间,单位是秒,无用的链接再过时后会被回收 --><property name="maxIdleTime" value="1800" /><!-- 数据库连接池初始化时获取的连接数 --><property name="initialPoolSize" value="2" /><!-- 在当前连接数耗尽的时候,一次获取的新的连接数 --><property name="acquireIncrement" value="2" /><!-- 每隔1800S检查数据库空闲连接 --><property name="idleConnectionTestPeriod" value="1800" /><!-- 当数据库连接失败以后尝试 重新连接的次数 --><property name="acquireRetryAttempts" value="30" /><!-- 性能消耗较大,判断是否对每个获取的连接进行校验是否有效 --><!-- 建议使用idleConnectoinTestPeriod和automaticTestTable来提升测试性能,默认:false --><property name="testConnectionOnCheckout" value="false" /><!-- JDBC标准参数,用来控制数据源内加载的PreparedStatement对象的数量但是由于缓存的statement是属于单个Connection的而不是整个连接池的,所以这项配置需要考虑多方面的因素如果maxStatement和maxStatementPerConnection都为0,则缓存关闭,模式:0 --><property name="maxStatements" value="0" /><!-- 对连接池的一种保护机制,当获取连接失败时会引起所有等待连接池来获取连接的线程抛出异常但是数据源仍然有效保留,并在下次调用getConnection时继续重新尝试获取连接如果设置为true,那么在尝试获取连接失败后,该数据源将申明已断开并永久关闭;默认:false --><property name="breakAfterAcquireFailure" value="true" /></bean></beans>
0 0
- Spring中C3P0数据源的配置
- spring中配置c3p0数据源
- 【转载】spring中配置c3p0数据源
- spring c3p0数据源配置
- spring c3p0数据源配置
- spring数据源c3p0配置
- spring数据源c3p0配置
- Spring的数据源配置 DBCP、C3P0、JNDI
- Spring的数据源配置 DBCP、C3P0、BoneCP
- Spring的数据源配置 DBCP、C3P0、BoneCP
- Spring的数据源配置 DBCP、C3P0、BoneCP
- c3p0、dbcp数据源在spring的配置
- c3p0数据源的配置
- spring 使用 c3p0 配置数据源
- Spring数据源配置之c3p0
- spring中C3P0的配置
- Spring配置C3P0数据源,并注入到hibernate的sessionFactory中
- Spring配置数据源的三种方式 (dbcp,c3p0,jndi)
- IFIX工作台中禁止Historian报错
- 从风险管理的角度来看是否需要个性化推荐
- 货物移动_免费收货(MvT511)
- hadoop从听说到入门
- CocoaPods一个Objective-C第三方库的管理利器
- Spring中C3P0数据源的配置
- 虚拟内存
- MySql - SQL Error (1130): Host IP is not allowed to connect to this MySQL server
- js 移位操作符
- 同步传输与异步传输的区别
- 2014—4—17——JAVA
- 编辑文章 - 博客频道 - CSDN.NET
- 黑马程序员——java开发前奏01
- jQuery整理笔记二----jQuery选择器整理