Package com.alibaba.druid.filter

Examples of com.alibaba.druid.filter.FilterAdapter


    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();

        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setFilters("stat,log4j,wall,encoding");
        dataSource.getProxyFilters().add(new FilterAdapter() {
        });
        dataSource.setDbType("mysql");

        dataSource.init();
    }
View Full Code Here


        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setDefaultAutoCommit(true);
        dataSource.setInitialSize(1);
        dataSource.getProxyFilters().add(new FilterAdapter() {
            public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
                ConnectionProxy conn = chain.connection_connect(info);
                conn.setAutoCommit(true);
                return conn;
            }
View Full Code Here

        dataSource = new DruidDataSource();

        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setFilters("stat");
        dataSource.setTestOnBorrow(false);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public java.io.InputStream resultSet_getAsciiStream(FilterChain chain, ResultSetProxy result,
                                                                int columnIndex) throws SQLException {
                return new ByteArrayInputStream(new byte[0]);
View Full Code Here

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

            public void connection_close(FilterChain chain, ConnectionProxy connection) throws SQLException {
                throw new SQLException();
            }
        });
View Full Code Here

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

        dataSource.getProxyFilters().add(new FilterAdapter() {

            public boolean callableStatement_wasNull(FilterChain chain, CallableStatementProxy statement)
                                                                                                         throws SQLException {
                if (throwError) {
                throw new SQLException();
View Full Code Here

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            public void connection_rollback(FilterChain chain, ConnectionProxy connection) throws SQLException {
                throw new SQLException();
            }
        });
View Full Code Here

        dataSource.setUrl("jdbc:mock:");
        dataSource.setAsyncCloseConnectionEnable(true);
        dataSource.setTestOnBorrow(false);
        dataSource.setMaxActive(16);

        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql)
                                                                                                     throws SQLException {
                throw new SQLException();
View Full Code Here

        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setTestOnBorrow(false);
        dataSource.setFilters("stat");
        dataSource.setPoolPreparedStatements(true);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public PreparedStatementProxy connection_prepareStatement(FilterChain chain, ConnectionProxy connection,
                                                                      String sql) throws SQLException {
                throw new SQLException();
View Full Code Here

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setInitialSize(1);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
                throw new RuntimeException();
            }
View Full Code Here

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        dataSource.setInitialSize(1);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
                throw new Error();
            }
View Full Code Here

TOP

Related Classes of com.alibaba.druid.filter.FilterAdapter

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.