文档章节

C3P0连接池配置

龙之天空
 龙之天空
发布于 2015/04/17 15:20
字数 3409
阅读 10
收藏 0
点赞 0
评论 0

C3P0是一个开源的JDBC连接池。

在Spring中,C3P0的一些配置,介绍如下(只列了一部分,不是全部)

[html] view plaincopy

  1. <!-- c3p0连接池配置 -->  

  2.      <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">  

  3.           <!-- 用户名-->  

  4.           <property name="user" value="${username}"/>  

  5.           <!-- 用户密码-->  

  6.           <property name="password" value="${password}"/>  

  7.           <property name="driverClass" value="${driver_class}"/>  

  8.           <property name="jdbcUrl" value="${url}"/>  

  9.   

  10.            <!--连接池中保留的最大连接数。默认值: 15 -->   

  11.           <property name="maxPoolSize" value="20"/>  

  12.           <!-- 连接池中保留的最小连接数,默认为:3-->  

  13.           <property name="minPoolSize" value="2"/>  

  14.           <!-- 初始化连接池中的连接数,取值应在minPoolSize与maxPoolSize之间,默认为3-->  

  15.           <property name="initialPoolSize" value="2"/>  

  16.   

  17.           <!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。默认值: 0 -->   

  18.           <property name="maxIdleTime">60</property>  

  19.             

  20.           <!-- 当连接池连接耗尽时,客户端调用getConnection()后等待获取新连接的时间,超时后将抛出SQLException,如设为0则无限期等待。单位毫秒。默认: 0 -->   

  21.           <property name="checkoutTimeout" value="3000"/>  

  22.             

  23.           <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。默认值: 3 -->   

  24.           <property name="acquireIncrement" value="2"/>  

  25.   

  26.          <!--定义在从数据库获取新连接失败后重复尝试的次数。默认值: 30 ;小于等于0表示无限次-->   

  27.           <property name="acquireRetryAttempts" value="0"/>  

  28.   

  29.           <!--重新尝试的时间间隔,默认为:1000毫秒-->   

  30.           <property name="acquireRetryDelay" value="1000" />  

  31.   

  32.           <!--关闭连接时,是否提交未提交的事务,默认为false,即关闭连接,回滚未提交的事务 -->   

  33.           <property name="autoCommitOnClose">false</property>  

  34.   

  35.           <!--c3p0将建一张名为Test的空表,并使用其自带的查询语句进行测试。如果定义了这个参数那么属性preferredTestQuery将被忽略。你不能在这张Test表上进行任何操作,它将只供c3p0测试使用。默认值: null -->   

  36.           <property name="automaticTestTable">Test</property>  

  37.   

  38.           <!-- 如果为false,则获取连接失败将会引起所有等待连接池来获取连接的线程抛出异常,但是数据源仍有效保留,并在下次调用getConnection() 的时候继续尝试获取连接。如果设为true,那么在尝试获取连接失败后该数据源将申明已断开并永久关闭。默认: false-->   

  39.           <property name="breakAfterAcquireFailure">false</property>  

  40.   

  41.           <!--每60秒检查所有连接池中的空闲连接。默认值: 0,不检查 -->   

  42.           <property name="idleConnectionTestPeriod">60</property>  

  43.           <!--c3p0全局的PreparedStatements缓存的大小。如果maxStatements与maxStatementsPerConnection均为0,则缓存不生效,只要有一个不为0,则语句的缓存就能生效。如果默认值: 0-->   

  44.           <property name="maxStatements">100</property>  

  45.           <!--maxStatementsPerConnection定义了连接池内单个连接所拥有的最大缓存statements数。默认值: 0 -->   

  46.           <property name="maxStatementsPerConnection"></property>  

  47.      </bean>  

==============================================================================================================

C3P0更详细的配置项及其含义,请参考:http://www.mchange.com/projects/c3p0/index.html,部分内容摘录如下:

acquireIncrement
acquireRetryAttempts
acquireRetryDelay
autoCommitOnClose
automaticTestTable
breakAfterAcquireFailure
checkoutTimeout
connectionCustomizerClassName
connectionTesterClassName
debugUnreturnedConnectionStackTraces
factoryClassLocation
forceIgnoreUnresolvedTransactions
idleConnectionTestPeriod
initialPoolSize
maxAdministrativeTaskTime
maxConnectionAge
maxIdleTime
maxIdleTimeExcessConnections
maxPoolSize
maxStatements
maxStatementsPerConnection
minPoolSize
numHelperThreads
overrideDefaultUser
overrideDefaultPassword
password
preferredTestQuery
propertyCycle
testConnectionOnCheckin
testConnectionOnCheckout
unreturnedConnectionTimeout
user
usesTraditionalReflectiveProxies
  • acquireIncrement

  • Default: 3

    Determines how many connections at a time c3p0 will try to acquire when the pool is exhausted. [See "Basic Pool Configuration"]

  • acquireRetryAttempts

  • Default: 30

    Defines how many times c3p0 will try to acquire a new Connection from the database before giving up. If this value is less than or equal to zero, c3p0 will keep trying to fetch a Connection indefinitely. [See "Configuring Recovery From Database Outages"]

  • acquireRetryDelay

  • Default: 1000

    Milliseconds, time c3p0 will wait between acquire attempts. [See "Configuring Recovery From Database Outages"]

  • autoCommitOnClose

  • Default: false

    The JDBC spec is unforgivably silent on what should happen to unresolved, pending transactions on Connection close. C3P0's default policy is to rollback any uncommitted, pending work. (I think this is absolutely, undeniably the right policy, but there is no consensus among JDBC driver vendors.) Setting autoCommitOnClose to true causes uncommitted pending work to be committed, rather than rolled back on Connection close. [Note: Since the spec is absurdly unclear on this question, application authors who wish to avoid bugs and inconsistent behavior should ensure that all transactions are explicitly either committed or rolled-back before close is called.] [See "Configuring Unresolved Transaction Handling"]

  • automaticTestTable

  • Default: null

    If provided, c3p0 will create an empty table of the specified name, and use queries against that table to test the Connection. If automaticTestTable is provided, c3p0 will generate its own test query, therefore any preferredTestQuery set will be ignored. You should not work with the named table after c3p0 creates it; it should be strictly for c3p0's use in testing your Connection. (If you define your own ConnectionTester, it must implement the QueryConnectionTester interface for this parameter to be useful.) [See "Configuring Connection Testing"]

  • breakAfterAcquireFailure

  • Default: false

    If true, a pooled DataSource will declare itself broken and be permanently closed if a Connection cannot be obtained from the database after making acquireRetryAttempts to acquire one. If false, failure to obtain a Connection will cause all Threads waiting for the pool to acquire a Connection to throw an Exception, but the DataSource will remain valid, and will attempt to acquire again following a call to getConnection(). [See "Configuring Recovery From Database Outages"]

  • checkoutTimeout

  • Default: 0

    The number of milliseconds a client calling getConnection() will wait for a Connection to be checked-in or acquired when the pool is exhausted. Zero means wait indefinitely. Setting any positive value will cause the getConnection() call to time-out and break with an SQLException after the specified number of milliseconds.

  • connectionCustomizerClassName

  • Default: null

    The fully qualified class-name of an implememtation of the ConnectionCustomizer interface, which users can implement to set up Connections when they are acquired from the database, or on check-out, and potentially to clean things up on check-in and Connection destruction. If standard Connection properties (holdability, readOnly, or transactionIsolation) are set in the ConnectionCustomizer's onAcquire() method, these will override the Connection default values.

  • connectionTesterClassName

  • Default: com.mchange.v2.c3p0.impl.DefaultConnectionTester

    The fully qualified class-name of an implememtation of the ConnectionTester interface, or QueryConnectionTester if you would like instances to have access to a user-configured preferredTestQuery. This can be used to customize how c3p0 DataSources test Connections, but with the introduction of automaticTestTable and preferredTestQuery configuration parameters, "rolling your own" should be overkill for most users. [See "Configuring Connection Testing"]

  • debugUnreturnedConnectionStackTraces

  • Default: false

    If true, and if unreturnedConnectionTimeout is set to a positive value, then the pool will capture the stack trace (via an Exception) of all Connection checkouts, and the stack traces will be printed when unreturned checked-out Connections timeout. This is intended to debug applications with Connection leaks, that is applications that occasionally fail to return Connections, leading to pool growth, and eventually exhaustion (when the pool hits maxPoolSize with all Connections checked-out and lost). This parameter should only be set while debugging, as capturing the stack trace will slow down every Connection check-out.

    Does Not Support Per-User Overrides.

  • factoryClassLocation

  • Default: null

    DataSources that will be bound by JNDI and use that API's Referenceable interface to store themselves may specify a URL from which the class capable of dereferencing a them may be loaded. If (as is usually the case) the c3p0 libraries will be locally available to the JNDI service, leave this set as null.

    Does Not Support Per-User Overrides.

  • forceIgnoreUnresolvedTransactions

  • Default: false

    Strongly disrecommended. Setting this to true may lead to subtle and bizarre bugs. This is a terrible setting, leave it alone unless absolutely necessary. It is here to workaround broken databases / JDBC drivers that do not properly support transactions, but that allow Connections' autoCommit flags to go to false regardless. If you are using a database that supports transactions "partially" (this is oxymoronic, as the whole point of transactions is to perform operations reliably and completely, but nonetheless such databases are out there), if you feel comfortable ignoring the fact that Connections with autoCommit == false may be in the middle of transactions and may hold locks and other resources, you may turn off c3p0's wise default behavior, which is to protect itself, as well as the usability and consistency of the database, by either rolling back (default) or committing (see c3p0.autoCommitOnClose above) unresolved transactions. This should only be set to true when you are sure you are using a database that allows Connections' autoCommit flag to go to false, but offers no other meaningful support of transactions. Otherwise setting this to true is just a bad idea. [See "Configuring Unresolved Transaction Handling"]

  • idleConnectionTestPeriod

  • Default: 0

    If this is a number greater than 0, c3p0 will test all idle, pooled but unchecked-out connections, every this number of seconds. [See "Configuring Connection Testing"]

  • initialPoolSize

  • Default: 3

    Number of Connections a pool will try to acquire upon startup. Should be between minPoolSize and maxPoolSize. [See "Basic Pool Configuration"]

  • maxAdministrativeTaskTime

  • Default: 0

    Seconds before c3p0's thread pool will try to interrupt an apparently hung task. Rarely useful. Many of c3p0's functions are not performed by client threads, but asynchronously by an internal thread pool. c3p0's asynchrony enhances client performance directly, and minimizes the length of time that critical locks are held by ensuring that slow jdbc operations are performed in non-lock-holding threads. If, however, some of these tasks "hang", that is they neither succeed nor fail with an Exception for a prolonged period of time, c3p0's thread pool can become exhausted and administrative tasks backed up. If the tasks are simply slow, the best way to resolve the problem is to increase the number of threads, via numHelperThreads. But if tasks sometimes hang indefinitely, you can use this parameter to force a call to the task thread's interrupt() method if a task exceeds a set time limit. [c3p0 will eventually recover from hung tasks anyway by signalling an "APPARENT DEADLOCK" (you'll see it as a warning in the logs), replacing the thread pool task threads, and interrupt()ing the original threads. But letting the pool go into APPARENT DEADLOCK and then recover means that for some periods, c3p0's performance will be impaired. So if you're seeing these messages, increasing numHelperThreads and setting maxAdministrativeTaskTime might help.maxAdministrativeTaskTime should be large enough that any resonable attempt to acquire a Connection from the database, to test a Connection, or two destroy a Connection, would be expected to succeed or fail within the time set. Zero (the default) means tasks are never interrupted, which is the best and safest policy under most circumstances. If tasks are just slow, allocate more threads. If tasks are hanging forever, try to figure out why, and maybe setting maxAdministrativeTaskTime can help in the meantime.

    Does Not Support Per-User Overrides.

  • maxConnectionAge

  • Default: 0

    Seconds, effectively a time to live. A Connection older than maxConnectionAge will be destroyed and purged from the pool. This differs from maxIdleTime in that it refers to absolute age. Even a Connection which has not been much idle will be purged from the pool if it exceeds maxConnectionAge. Zero means no maximum absolute age is enforced.

  • maxIdleTime

  • Default: 0

    Seconds a Connection can remain pooled but unused before being discarded. Zero means idle connections never expire. [See "Basic Pool Configuration"]

  • maxIdleTimeExcessConnections

  • Default: 0

    Number of seconds that Connections in excess of minPoolSize should be permitted to remain idle in the pool before being culled. Intended for applications that wish to aggressively minimize the number of open Connections, shrinking the pool back towards minPoolSize if, following a spike, the load level diminishes and Connections acquired are no longer needed. If maxIdleTime is set,maxIdleTimeExcessConnections should be smaller if the parameter is to have any effect. Zero means no enforcement, excess Connections are not idled out.

  • maxPoolSize

  • Default: 15

    Maximum number of Connections a pool will maintain at any given time. [See "Basic Pool Configuration"]

  • maxStatements

  • Default: 0

    The size of c3p0's global PreparedStatement cache. If both maxStatements and maxStatementsPerConnection are zero, statement caching will not be enabled. If maxStatements is zero butmaxStatementsPerConnection is a non-zero value, statement caching will be enabled, but no global limit will be enforced, only the per-connection maximum. maxStatements controls the total number of Statements cached, for all Connections. If set, it should be a fairly large number, as each pooled Connection requires its own, distinct flock of cached statements. As a guide, consider how many distinct PreparedStatements are used frequently in your application, and multiply that number by maxPoolSize to arrive at an appropriate value. Though maxStatements is the JDBC standard parameter for controlling statement caching, users may find c3p0's alternative maxStatementsPerConnection more intuitive to use. [See "Configuring Statement Pooling"]

  • maxStatementsPerConnection

  • Default: 0

    The number of PreparedStatements c3p0 will cache for a single pooled Connection. If both maxStatements and maxStatementsPerConnection are zero, statement caching will not be enabled. IfmaxStatementsPerConnection is zero but maxStatements is a non-zero value, statement caching will be enabled, and a global limit enforced, but otherwise no limit will be set on the number of cached statements for a single Connection. If set, maxStatementsPerConnection should be set to about the number distinct PreparedStatements that are used frequently in your application, plus two or three extra so infrequently statements don't force the more common cached statements to be culled. Though maxStatements is the JDBC standard parameter for controlling statement caching, users may find maxStatementsPerConnection more intuitive to use. [See "Configuring Statement Pooling"]

  • minPoolSize

  • Default: 3

    Minimum number of Connections a pool will maintain at any given time. [See "Basic Pool Configuration"]

  • numHelperThreads

  • Default: 3

    c3p0 is very asynchronous. Slow JDBC operations are generally performed by helper threads that don't hold contended locks. Spreading these operations over multiple threads can significantly improve performance by allowing multiple operations to be performed simultaneously.

    Does Not Support Per-User Overrides.

  • overrideDefaultUser

  • Default: null

    Forces the username that should by PooledDataSources when a user calls the default getConnection() method. This is primarily useful when applications are pooling Connections from a non-c3p0 unpooled DataSource. Applications that use ComboPooledDataSource, or that wrap any c3p0-implemented unpooled DataSource can use the simple user property.

    Does Not Support Per-User Overrides.

  • overrideDefaultPassword

  • Default: null

    Forces the password that should by PooledDataSources when a user calls the default getConnection() method. This is primarily useful when applications are pooling Connections from a non-c3p0 unpooled DataSource. Applications that use ComboPooledDataSource, or that wrap any c3p0-implemented unpooled DataSource can use the simple password property.

    Does Not Support Per-User Overrides.

  • password

  • Default: null

    For applications using ComboPooledDataSource or any c3p0-implemented unpooled DataSources — DriverManagerDataSource or the DataSource returned by DataSources.unpooledDataSource( ... ) — defines the password that will be used for the DataSource's default getConnection() method. (See also user.)

    Does Not Support Per-User Overrides.

  • preferredTestQuery

  • Default: null

    Defines the query that will be executed for all connection tests, if the default ConnectionTester (or some other implementation of QueryConnectionTester, or better yet FullQueryConnectionTester) is being used. Defining a preferredTestQuery that will execute quickly in your database may dramatically speed up Connection tests. (If no preferredTestQuery is set, the default ConnectionTester executes a getTables() call on the Connection's DatabaseMetaData. Depending on your database, this may execute more slowly than a "normal" database query.) NOTE: The table against which your preferredTestQuery will be run must exist in the database schema prior to your initialization of your DataSource. If your application defines its own schema, tryautomaticTestTable instead. [See "Configuring Connection Testing"]

  • propertyCycle

  • Default: 0

    Maximum time in seconds before user configuration constraints are enforced. Determines how frequently maxConnectionAge, maxIdleTime, maxIdleTimeExcessConnections, unreturnedConnectionTimeoutare enforced. c3p0 periodically checks the age of Connections to see whether they've timed out. This parameter determines the period. Zero means automatic: A suitable period will be determined by c3p0. [You can call getEffectivePropertyCycle...() methods on a c3p0 PooledDataSource to find the period automatically chosen.]

  • testConnectionOnCheckin

  • Default: false

    If true, an operation will be performed asynchronously at every connection checkin to verify that the connection is valid. Use in combination with idleConnectionTestPeriod for quite reliable, always asynchronous Connection testing. Also, setting an automaticTestTable or preferredTestQuery will usually speed up all connection tests. [See "Configuring Connection Testing"]

  • testConnectionOnCheckout

  • Default: false

    Use only if necessary. Expensive. If true, an operation will be performed at every connection checkout to verify that the connection is valid. Better choice: verify connections periodically usingidleConnectionTestPeriod. Also, setting an automaticTestTable or preferredTestQuery will usually speed up all connection tests. [See "Configuring Connection Testing"]

  • unreturnedConnectionTimeout

  • Default: 0

    Seconds. If set, if an application checks out but then fails to check-in [i.e. close()] a Connection within the specified period of time, the pool will unceremoniously destroy() the Connection. This permits applications with occasional Connection leaks to survive, rather than eventually exhausting the Connection pool. And that's a shame. Zero means no timeout, applications are expected to close() their own Connections. Obviously, if a non-zero value is set, it should be to a value longer than any Connection should reasonably be checked-out. Otherwise, the pool will occasionally kill Connections in active use, which is bad. This is basically a bad idea, but it's a commonly requested feature. Fix your $%!@% applications so they don't leak Connections! Use this temporarily in combination with debugUnreturnedConnectionStackTraces to figure out where Connections are being checked-out that don't make it back into the pool!

  • user

  • Default: null

    For applications using ComboPooledDataSource or any c3p0-implemented unpooled DataSources — DriverManagerDataSource or the DataSource returned by DataSources.unpooledDataSource() — defines the username that will be used for the DataSource's default getConnection() method. (See also password.)

    Does Not Support Per-User Overrides.

  • usesTraditionalReflectiveProxies

  • Default: false

    c3p0 originally used reflective dynamic proxies for implementations of Connections and other JDBC interfaces. As of c3p0-0.8.5, non-reflective, code-generated implementations are used instead. As this was a major change, and the old codebase had been extensively used and tested, this parameter was added to allow users to revert of they had problems. The new, non-reflexive implementation is faster, and has now been widely deployed and tested, so it is unlikely that this parameter will be useful. Both the old reflective and newer non-reflective codebases are being maintained, but support for the older codebase may (or may not) be dropped in the future.

=======================================================================================================================

一个task应用数据库连接配置的例子:

[html] view plaincopy

  1. <bean id="dataSource" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">   

  2.           <property name="staticMethod">  

  3.               <value>com.mchange.v2.c3p0.DataSources.pooledDataSource</value>  

  4.           </property>  

  5.           <property name="arguments">  

  6.               <list>  

  7.                 <ref local="olpsUnpooledDataSource"/>  

  8.                     <props>  

  9.                         <prop key="acquireIncrement">1</prop>  

  10.                         <prop key="initialPoolSize">1</prop>  

  11.                         <prop key="minPoolSize">1</prop>  

  12.                         <prop key="maxPoolSize">5</prop>  

  13.                         <prop key="maxIdleTime">1800</prop>  

  14.                         <prop key="maxIdleTimeExcessConnections">1000</prop> <!-- 自动收缩连接用的,单位秒-->  

  15.                         <!-- 自动重连需要的三个参数  -->  

  16.                         <prop key="acquireRetryAttempts">30</prop>  

  17.                         <prop key="acquireRetryDelay">1000</prop>  

  18.                         <prop key="breakAfterAcquireFailure">false</prop>  

  19.                         <!-- 获取一个connection需要的时间,单位毫秒 -->  

  20.                         <prop key="checkoutTimeout">500</prop>  

  21.                     </props>  

  22.             </list>  

  23.         </property>  

  24.     </bean>  

  25.          

  26.     <bean id="olpsUnpooledDataSource" class="com.mchange.v2.c3p0.DriverManagerDataSource">   

  27.         <property name="driverClass">  

  28.             <value>com.alibaba.china.jdbc.SimpleDriver</value>  

  29.         </property>  

  30.         <property name="jdbcUrl">  

  31.             <value>${database.driver.url}</value>  

  32.         </property>  

  33.         <property name="properties">  

  34.             <bean class="com.alibaba.china.biz.common.security.SecureIdentityLoginModule">  

  35.                 <property name="user"><value>${username}</value></property>  

  36.                 <property name="password"><value>${password}</value></property>  

  37.                 <property name="bigStringTryClob"><value>true</value></property>  

  38.                 <property name="clientEncoding"><value>GBK</value></property>  

  39.                 <property name="serverEncoding"><value>ISO-8859-1</value></property>  

  40.             </bean>  

  41.         </property>  

  42.     </bean> 


本文转载自:http://blog.csdn.net/caihaijiang/article/details/6843496

共有 人打赏支持
龙之天空
粉丝 7
博文 79
码字总数 18140
作品 0
宁波
Hibernate c3p0 数据库连接池

From :http://www.codeweblog.com/hibernate-using-c3p0-connection-pooling/ c3p0是开源JDBC连接池,Hibernate的发布版也有此功能。这篇文章描述怎样使用Hibernate来配置从c3p0。C3p0连接池...

boonya
2014/07/14
0
0
数据库连接池DBCP和C3P0的使用

hibernate开发组推荐使用c3p0; spring开发组推荐使用dbcp; hibernate in action推荐使用c3p0; 一. dbcp 在数据库服务器强行关闭连接或数据库服务重启后,无法reconnect 二. dbcp 连接池的创建...

mn_1127
2015/08/27
0
0
Hibernate连接配置方法剖析

这里介绍Hibernate连接配置方法,包括介绍在c3p0和dbcp中,都是必需的,因为Hibernate会根据上述的配置来生成connections,再交给c3p0或dbcp管理.但是,proxool则不能。 AD: Hibernate有很多...

dong.li
2012/04/24
0
0
c3p0、dbcp、tomcat jdbc pool 连接池区别

查看资料,得知dbcp和c3p0都是单线程的,在高并发的环境下性能会非常低下, 决定换用tomcat自带的jdbc-pool,关于jdbc-pool的项目介绍。 区别参考链接:http://www.open-open.com/lib/view/o...

张嘴吃药
2017/10/30
0
0
c3p0数据库连接池的使用详解

首先,什么是c3p0?下面是百度百科的解释: C3P0是一个开源的JDBC连接池,它实现了数据源和JNDI绑定,支持JDBC3规范和JDBC2的标准扩展。目前使用它的开源项目有Hibernate,Spring   使用连接池...

冬至饮雪
2016/02/06
0
0
解决MySql数据库连接超时问题

在Mysql的默认设置中,如果一个数据库连接超过8小时没有使用(闲置8小时,即28800s),mysql server将主动断开这条连接。![在此输入图片描述][1] 在运维监控系统中,程序会报如下异常: 底层...

gerry_pang
2013/11/22
0
0
hibernate 连接池 转

Hibernate支持DBCP包进行数据库连接池的配置。简要说明配置过程: (仅仅是个人摸索,如有问题,欢迎指点) 需要的包: Commons-Pool (下载地址:http://jakarta.apache.org/commons/pool/):...

asdtiang
2010/02/22
0
0
Spring之jdbc Template实现CRUD操作

Spring为各种持久化技术都提供了简单操作的模板回调。比如jdbc、hibernate、Mybatis以及JPA等。 这里我们就以JDBC为例,看看JDBC template怎么实现CRUD操作。 JdbcTemplate主要提供以下几类方...

Java攻城玩家
05/31
0
0
C3P0的详细配置说明(com.mchange.v2.c3p0.ComboPooledDataSource)

C3P0是一个开放源代码的JDBC连接池,它在lib目录中与Hibernate一起发布,包括了实现jdbc3和jdbc2扩展规范说明的Connection 和Statement 池的DataSources 对象。 c3p0-config> <default-config...

叶建平
2010/12/31
0
0
com.mchange.v2.c3p0.combopooleddatasource配置的那些破事

<default-config>   <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->   <property name="acquireIncrement">3</property>   <!--定义在从数据库获取新连接失......

蔡少东
2015/01/06
0
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

python3.6用的外库遇到的问题

要用到wmi库 pip install wmi 装后不能用还要安装pywin32库。 要用到crypto加密模块安装pip instal pycrypto装后不能用。要安装pycryptodome。...

oisan_
8分钟前
0
0
select, poll, epoll I/O复用介绍

什么是I/O复用? 内核监视多个文件描述符(I/O文件句柄),一旦某个描述符就绪(一般是读就绪或者写就绪),能够通知应用程序进行相应的读写操作。 I/O多路复用又被称为“事件驱动”(比如读写事...

xiaoxlm
8分钟前
0
0
【Spring 系列 给IOC容器添加组件的几种方式总结】

给Spring 注册Bean的几种方式总结。其中使用@Import注解是Spring Boot 完成自动配置的一个核心注解。 1、Spring 中给IOC容器添加组件的几种方式 在Spring的配置文件中,配置Bean(基于XML方式...

HansonReal
9分钟前
3
0
bootstrapTable语言包设置

###方法一引入不同的语言包 <script src="bootstrap-table-zh-CN.js"></script> ###方法二引入全语言包 <script src="bootstrap-table-locale-all.min.js"></script>//然后在初始化前设计默......

momo1987
10分钟前
0
0
Saltstack 常用命令

1、拷贝文件到客户端 # salt 'slaver.test.com' cp.get_file salt://apache.sls /tmp/cp.txt 2、拷贝目录到客户端 # salt 'slaver.test.com' cp.get_dir salt://test /tmp 3、显示存活的客户......

硅谷课堂
10分钟前
0
0
致初学者-如何学好Python这门编程语言?[图]

致初学者-如何学好Python这门编程语言?[图]: 对于很多Python3初学者,往往会面临以下问题:Python2和Python3我该学习哪一个?是否要安装Linux系统学习Python?Python3有各种版本我该安装哪...

原创小博客
13分钟前
1
0
E31---setopt=protected_multilib=false

今天在云服务器上装nginx,需要先安装一些依赖库比如zlib, ,但是安装zlib时候报错。 yum install -y zlib zlib-devel 1 (-y 指的是如果需要选yes no的自动y)下面是报错 Protected multil...

侠客行之石头
17分钟前
0
0
HTTP常见面试题

Http与Https的区别: HTTP 的URL 以http:// 开头,而HTTPS 的URL 以https:// 开头 HTTP 是不安全的,而 HTTPS 是安全的 HTTP 标准端口是80 ,而 HTTPS 的标准端口是443 在OSI 网络模型中,H...

JK_OPERA
19分钟前
0
0
python爬取站长素材网页图片保存到ppt中

网站地址:http://sc.chinaz.com/tupian/index.html 直接上代码: import requestsfrom bs4 import BeautifulSoupfrom pptx import Presentationfrom pptx.util import Inchesimpor......

你为什么不吃药
21分钟前
1
0
Ubuntu 18.04 swap空间的修改

一、准备工作 执行“sudo swapon -s”命令,查看是否已经存在swap file 二、修改swap file # 如果第一步存在swapfile则需要先禁用sudo swapoff /swapfile# 修改swap 空间的大小为2Gs...

Iceberg_XTY
24分钟前
1
0

没有更多内容

加载失败,请刷新页面

加载更多

下一页

返回顶部
顶部