Search in sources :

Example 1 with LocalTxDataSource

use of com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource in project druid by alibaba.

the class Case4 method test_jobss.

public void test_jobss() throws Exception {
    LocalTxDataSourceDO dataSourceDO = new LocalTxDataSourceDO();
    dataSourceDO.setBlockingTimeoutMillis(1000 * 60);
    dataSourceDO.setMaxPoolSize(maxPoolSize);
    dataSourceDO.setMinPoolSize(minPoolSize);
    dataSourceDO.setDriverClass(driverClass);
    dataSourceDO.setConnectionURL(jdbcUrl);
    dataSourceDO.setUserName(user);
    dataSourceDO.setPassword(password);
    LocalTxDataSource tx = TaobaoDataSourceFactory.createLocalTxDataSource(dataSourceDO);
    DataSource dataSource = tx.getDatasource();
    for (int i = 0; i < loopCount; ++i) {
        p0(dataSource, "jboss-datasource", threadCount);
    }
    System.out.println();
}
Also used : LocalTxDataSourceDO(com.taobao.datasource.LocalTxDataSourceDO) LocalTxDataSource(com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource) LocalTxDataSource(com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource) BasicDataSource(org.apache.commons.dbcp.BasicDataSource) BoneCPDataSource(com.jolbox.bonecp.BoneCPDataSource) ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource) ProxoolDataSource(org.logicalcobwebs.proxool.ProxoolDataSource) DruidDataSource(com.alibaba.druid.pool.DruidDataSource) DataSource(javax.sql.DataSource)

Example 2 with LocalTxDataSource

use of com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource in project druid by alibaba.

the class Case1 method test_jobss.

public void test_jobss() throws Exception {
    LocalTxDataSourceDO dataSourceDO = new LocalTxDataSourceDO();
    dataSourceDO.setBlockingTimeoutMillis(1000 * 60);
    dataSourceDO.setMaxPoolSize(maxPoolSize);
    dataSourceDO.setMinPoolSize(minPoolSize);
    dataSourceDO.setDriverClass(driverClass);
    dataSourceDO.setConnectionURL(jdbcUrl);
    dataSourceDO.setUserName(user);
    dataSourceDO.setPassword(password);
    LocalTxDataSource tx = TaobaoDataSourceFactory.createLocalTxDataSource(dataSourceDO);
    DataSource dataSource = tx.getDatasource();
    for (int i = 0; i < loopCount; ++i) {
        p0(dataSource, "jboss-datasource", threadCount);
    }
    System.out.println();
}
Also used : LocalTxDataSourceDO(com.taobao.datasource.LocalTxDataSourceDO) LocalTxDataSource(com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource) LocalTxDataSource(com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource) BasicDataSource(org.apache.commons.dbcp.BasicDataSource) BoneCPDataSource(com.jolbox.bonecp.BoneCPDataSource) ComboPooledDataSource(com.mchange.v2.c3p0.ComboPooledDataSource) ProxoolDataSource(org.logicalcobwebs.proxool.ProxoolDataSource) DruidDataSource(com.alibaba.druid.pool.DruidDataSource) DataSource(javax.sql.DataSource)

Aggregations

DruidDataSource (com.alibaba.druid.pool.DruidDataSource)2 BoneCPDataSource (com.jolbox.bonecp.BoneCPDataSource)2 ComboPooledDataSource (com.mchange.v2.c3p0.ComboPooledDataSource)2 LocalTxDataSourceDO (com.taobao.datasource.LocalTxDataSourceDO)2 LocalTxDataSource (com.taobao.datasource.resource.adapter.jdbc.local.LocalTxDataSource)2 DataSource (javax.sql.DataSource)2 BasicDataSource (org.apache.commons.dbcp.BasicDataSource)2 ProxoolDataSource (org.logicalcobwebs.proxool.ProxoolDataSource)2