Package com.alibaba.druid.pool

Examples of com.alibaba.druid.pool.DruidDataSource


    protected void setUp() throws Exception {
        executor = Executors.newFixedThreadPool(100);
        scheduler = Executors.newScheduledThreadPool(10);
        for (int i = 0; i < dataSources.length; ++i) {
            DruidDataSource dataSource = new DruidDataSource();
            dataSource.setMaxActive(8);
            dataSource.setMinIdle(0);
            dataSource.setUrl("jdbc:mock:xxx");
            dataSource.setCreateScheduler(scheduler);
            dataSource.setDestroyScheduler(scheduler);
            dataSource.setTestOnBorrow(false);
            dataSource.setTestWhileIdle(false);
            dataSource.setAsyncCloseConnectionEnable(true);

            dataSources[i] = dataSource;
        }
    }
View Full Code Here


            public ResultSet createResultSet(MockPreparedStatement stmt) {
                return null;
            }
        };
       
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xx");
        dataSource.setDriver(driver);
    }
View Full Code Here

    private final AtomicBoolean validate = new AtomicBoolean(true);

    protected void setUp() throws Exception {
        validate.set(true);
       
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setInitialSize(1);

        dataSource.setValidConnectionChecker(new ValidConnectionCheckerAdapter() {
View Full Code Here

    private DruidDataSource dataSource;
    private MockDriver      driver;

    protected void setUp() throws Exception {
        driver = new MockDriver();
        dataSource = new DruidDataSource();
        dataSource.setDriver(driver);
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setFilters("stat,trace,log4j,encoding");
        dataSource.setDefaultAutoCommit(false);
    }
View Full Code Here

    protected void setUp() throws Exception {
        ctxClassLoader = Thread.currentThread().getContextClassLoader();
        Thread.currentThread().setContextClassLoader(null);

        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:");
        dataSource.setPoolPreparedStatements(false);
        dataSource.setTestOnBorrow(true);
        dataSource.setFilters("stat");
    }
View Full Code Here

    private DruidDataSource dataSource;

    private AtomicInteger   validCount = new AtomicInteger();

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(true);
        dataSource.setValidationQuery("select 'x'");
        dataSource.setValidConnectionChecker(new ValidConnectionCheckerAdapter() {
View Full Code Here

public class DruidDataSourceTest_getProperties extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.getConnectProperties().put("user", "jobs");
        dataSource.getConnectProperties().put("password", "xxx");
        dataSource.init();
View Full Code Here

    private final AtomicInteger returnEmptyCount = new AtomicInteger();

    protected void setUp() throws Exception {
        returnEmptyCount.set(0);

        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(true);
        dataSource.setInitialSize(1);
        dataSource.setValidationQuery("select 1");
        dataSource.setValidationQueryTimeout(10);
View Full Code Here

public class DruidDataSourceTest_maxActive4 extends TestCase {

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setFilters("stat");
        dataSource.setMinIdle(4);
        dataSource.setMaxActive(8);
View Full Code Here

            }
        };

        // /////////////////////////////

        dataSource = new DruidDataSource();

        dataSource.setDriver(driver);
        dataSource.setUrl("jdbc:mock:xx");
        dataSource.setFilters("stat");
        dataSource.setMaxOpenPreparedStatements(30);
View Full Code Here

TOP

Related Classes of com.alibaba.druid.pool.DruidDataSource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.