当前位置: 首页>>代码示例>>Java>>正文


Java C3P0Registry类代码示例

本文整理汇总了Java中com.mchange.v2.c3p0.C3P0Registry的典型用法代码示例。如果您正苦于以下问题:Java C3P0Registry类的具体用法?Java C3P0Registry怎么用?Java C3P0Registry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


C3P0Registry类属于com.mchange.v2.c3p0包,在下文中一共展示了C3P0Registry类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: closePolledDataSources

import com.mchange.v2.c3p0.C3P0Registry; //导入依赖的package包/类
/**
 * Close all pooled datasources created by C3P0.
 */
public static void closePolledDataSources() {
	for (PooledDataSource dataSource:(Set<PooledDataSource>)C3P0Registry.allPooledDataSources()) {
		try {
			dataSource.close();
			DataSources.destroy(dataSource);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:javalover123,项目名称:full-hibernate-plugin-for-struts2,代码行数:14,代码来源:C3P0Util.java

示例2: collectDBPoolMetrics

import com.mchange.v2.c3p0.C3P0Registry; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public void collectDBPoolMetrics(MonitorElement clientElem) {

    Set dsList = C3P0Registry.getPooledDataSources();

    if (dsList == null || dsList.size() == 0) {
        return;
    }

    /**
     * Step 2: 匹配对应的jdbc url
     */
    for (Object ds : dsList) {

        if (!ComboPooledDataSource.class.isAssignableFrom(ds.getClass())) {
            continue;
        }

        ComboPooledDataSource pds = (ComboPooledDataSource) ds;

        String jdbcURL = pds.getJdbcUrl();

        /**
         * 匹配客户端应用
         */
        MonitorElementInstance inst = this.matchElemInstance(clientElem, jdbcURL);

        if (inst == null) {
            continue;
        }

        collectDataSourceStat(inst, pds);
    }
}
 
开发者ID:uavorg,项目名称:uavstack,代码行数:36,代码来源:C3P0HookProxy.java

示例3: selectDataSource

import com.mchange.v2.c3p0.C3P0Registry; //导入依赖的package包/类
@Override
public synchronized DataSource selectDataSource(String tenantIdentifier) {
    PooledDataSource pooledDataSource = C3P0Registry.pooledDataSourceByName(tenantIdentifier);
    if (pooledDataSource == null) {
        pooledDataSource = proccessDataSource(tenantIdentifier);
    }
    return pooledDataSource;
}
 
开发者ID:mojtaba-sharif,项目名称:multi-tenancy,代码行数:9,代码来源:BaseMultiTenantConnectionProviderImp.java

示例4: selectDataSource

import com.mchange.v2.c3p0.C3P0Registry; //导入依赖的package包/类
@Override
public synchronized DataSource selectDataSource(String tenantIdentifier) {
    PooledDataSource pooledDataSource = C3P0Registry.pooledDataSourceByName(tenantIdentifier);
    if (pooledDataSource == null) {
        pooledDataSource = proccessDataSource(tenantIdentifier);
    }
    System.out.println("select-data-source-base-multi-tenant");
    return pooledDataSource;
}
 
开发者ID:mojtaba-sharif,项目名称:repository-multi-tenancy,代码行数:10,代码来源:BaseMultiTenantConnectionProviderImp.java

示例5: getCatalogDS

import com.mchange.v2.c3p0.C3P0Registry; //导入依赖的package包/类
public static DataSource getCatalogDS() {
	@SuppressWarnings("unchecked")
	Set<DataSource> c3p0pools = C3P0Registry.allPooledDataSources(); 
	return c3p0pools.iterator().next();
}
 
开发者ID:Tesora,项目名称:tesora-dve-pub,代码行数:6,代码来源:CatalogDAO.java


注:本文中的com.mchange.v2.c3p0.C3P0Registry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。