Package com.alibaba.druid.proxy

Examples of com.alibaba.druid.proxy.DruidDriver.connect()


    public void test_driver_wrap() throws Exception {
        DruidDriver driver = new DruidDriver();

        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters=:name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here


                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters=,:name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters=,:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters=,:name=:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:driver=:filters=,:name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
View Full Code Here

                                                                            new Properties());
            Assert.assertEquals(0, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
        }
        {
            ConnectionProxyImpl conn = (ConnectionProxyImpl) driver.connect("jdbc:wrap-jdbc:filters="
                                                                                    + PublicJdbcFilterAdapter.class.getName()
                                                                                    + ":name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                                                                            new Properties());
            Assert.assertEquals(1, conn.getDirectDataSource().getProxyFilters().size());
            conn.close();
View Full Code Here

            conn.close();
        }
        {
            Exception error = null;
            try {
                driver.connect("jdbc:wrap-jdbc:filters=" + PrivateJdbcFilterAdapter.class.getName()
                                       + ":name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                               new Properties()).close();
            } catch (Exception ex) {
                error = ex;
            }
View Full Code Here

            Assert.assertNotNull(error);
        }
        {
            Exception error = null;
            try {
                driver.connect("jdbc:wrap-jdbc:filters=" + InitErrorJdbcFilterAdapter.class.getName()
                                       + ":name=driverWrapperTest:jdbc:derby:memory:driverWrapperTestDB;create=true",
                               new Properties()).close();
            } catch (Exception ex) {
                error = ex;
            }
View Full Code Here

    public void test_clone() throws Exception {
        Class.forName("com.alibaba.druid.proxy.DruidDriver");

        DruidDriver driver = (DruidDriver) DriverManager.getDriver(url);

        ConnectionProxyImpl connection = (ConnectionProxyImpl) driver.connect(url, new Properties());

        connection.getRawObject();

        FilterChain filterChain = (FilterChain) connection.createChain();
        filterChain.cloneChain();
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.