Package com.alibaba.druid.filter

Examples of com.alibaba.druid.filter.FilterAdapter


            public char[] getPassword() {
                return "xx".toCharArray();
            }
        });

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

            public ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql)
                                                                                                                 throws SQLException {
                if (errorCount.get() > 0) {
                    errorCount.decrementAndGet();
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.setFilters("stat");
        dataSource.setTestOnBorrow(false);
        dataSource.getProxyFilters().add(new FilterAdapter() {

            @Override
            public java.io.Reader resultSet_getCharacterStream(FilterChain chain, ResultSetProxy result, int columnIndex)
                                                                                                                         throws SQLException {
                return new StringReader("");
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 int connection_getTransactionIsolation(FilterChain chain, ConnectionProxy connection)
                                                                                                        throws SQLException {
                throw new com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException();
            }
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 Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex)
                                                                                                      throws SQLException {
                return new ClobProxyImpl(result.getStatementProxy().getConnectionProxy().getDirectDataSource(),
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 byte[] resultSet_getBytes(FilterChain chain, ResultSetProxy result, int columnIndex)
                                                                                                       throws SQLException {
                return new byte[6];
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 ConnectionProxy connection_connect(FilterChain chain, Properties info) throws SQLException {
                throw new SQLException();
            }
        });
View Full Code Here

    private DruidDataSource dataSource;

    protected void setUp() throws Exception {
        dataSource = new DruidDataSource();
        dataSource.setUrl("jdbc:mock:xxx");
        Filter filter = new FilterAdapter() {
            @Override
            public int connection_getHoldability(FilterChain chain, ConnectionProxy connection) throws SQLException {
                throw new UnsupportedOperationException();
            }
        };
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 Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex)
                                                                                                        throws SQLException {
                return new MockBlob();
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(false);
                return conn;
            }
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.