Examples of ValidConnectionCheckerAdapter


Examples of com.alibaba.druid.pool.ValidConnectionCheckerAdapter

        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setInitialSize(1);

        dataSource.setValidConnectionChecker(new ValidConnectionCheckerAdapter() {

            @Override
            public boolean isValidConnection(Connection c, String query, int validationQueryTimeout) {
                return validate.get();
            }
View Full Code Here

Examples of com.alibaba.druid.pool.ValidConnectionCheckerAdapter

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

            @Override
            public boolean isValidConnection(Connection c, String query, int validationQueryTimeout) {
                int count = validCount.getAndIncrement();
               
View Full Code Here

Examples of com.alibaba.druid.pool.ValidConnectionCheckerAdapter

        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setTestWhileIdle(true);
        dataSource.setTimeBetweenEvictionRunsMillis(20);
        dataSource.setValidationQuery("select 'x'");
        dataSource.setValidConnectionChecker(new ValidConnectionCheckerAdapter() {

            @Override
            public boolean isValidConnection(Connection c, String query, int validationQueryTimeout) {
                int count = validCount.getAndIncrement();
View Full Code Here

Examples of com.alibaba.druid.pool.ValidConnectionCheckerAdapter

import com.alibaba.druid.pool.ValidConnectionCheckerAdapter;


public class ValidConnectionCheckerAdapterTest extends TestCase {
    public void test_adapter() throws Exception {
        ValidConnectionCheckerAdapter adapter = new ValidConnectionCheckerAdapter();
        adapter.configFromProperties(System.getProperties());
        Assert.assertTrue(adapter.isValidConnection(null, null, 10));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.