• c3p0配置xml


    c3p0-config.xml
    
    <c3p0-config> 
    <default-config> 
    <property name="automaticTestTable">con_test</property> 
    <property name="checkoutTimeout">30000</property> 
    <property name="idleConnectionTestPeriod">30</property> 
    <property name="initialPoolSize">10</property> 
    <property name="maxIdleTime">30</property> 
    <property name="maxPoolSize">100</property> 
    <property name="minPoolSize">10</property> 
    <property name="maxStatements">200</property> 
    <user-overrides user="test-user"> 
    <property name="maxPoolSize">10</property> 
    <property name="minPoolSize">1</property> 
    <property name="maxStatements">0</property> 
    </user-overrides> 
    </default-config> 
    <!-- This app is massive! --> 
    <named-config name="intergalactoApp"> 
    <property name="acquireIncrement">50</property> 
    <property name="initialPoolSize">100</property> 
    <property name="minPoolSize">50</property> 
    <property name="maxPoolSize">1000</property> 
    <!-- intergalactoApp adopts a different approach to configuring statement caching --> 
    <property name="maxStatements">0</property> 
    <property name="maxStatementsPerConnection">5</property> 
    <!-- he's important, but there's only one of him --> 
    <user-overrides user="master-of-the-universe"> 
    <property name="acquireIncrement">1</property> 
    <property name="initialPoolSize">1</property> 
    <property name="minPoolSize">1</property> 
    <property name="maxPoolSize">5</property> 
    <property name="maxStatementsPerConnection">50</property> 
    </user-overrides> 
    </named-config> 
    </c3p0-config>
    
    using ComboPooledDataSource: ComboPooledDataSource cpds = new ComboPooledDataSource("intergalactoApp"); 
    
    using the DataSources factory class: DataSource ds_pooled = DataSources.pooledDataSource( ds_unpooled, "intergalactoApp" ); 
  • 相关阅读:
    POJ 2503 Babelfish
    POJ 2528 Mayor's posters
    203C Photographer
    190A Vasya and the Bus
    POJ 3630 Trie树 TLE
    ThinkPHP验证码的使用
    mysql_fetch_row、mysql_fetch_array、mysql_fetch_assoc、mysql_fetch_object
    ThinkPHP模版布局方式
    Windows 下使用Git管理Github项目
    浅析mysql、mysqli、PDO
  • 原文地址:https://www.cnblogs.com/zjwia/p/3147864.html
Copyright © 2020-2023  润新知