Search in sources :

Example 1 with StringReader

use of org.nutz.lang.stream.StringReader in project druid by alibaba.

the class StatFilterOpenReaderCountTest method setUp.

protected void setUp() throws Exception {
    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("");
        }

        @Override
        public java.io.Reader resultSet_getCharacterStream(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
            return new StringReader("");
        }
    });
    dataSource.init();
}
Also used : SQLException(java.sql.SQLException) FilterChain(com.alibaba.druid.filter.FilterChain) StringReader(org.nutz.lang.stream.StringReader) FilterAdapter(com.alibaba.druid.filter.FilterAdapter) StringReader(org.nutz.lang.stream.StringReader) ResultSetProxy(com.alibaba.druid.proxy.jdbc.ResultSetProxy) DruidDataSource(com.alibaba.druid.pool.DruidDataSource)

Aggregations

FilterAdapter (com.alibaba.druid.filter.FilterAdapter)1 FilterChain (com.alibaba.druid.filter.FilterChain)1 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)1 ResultSetProxy (com.alibaba.druid.proxy.jdbc.ResultSetProxy)1 SQLException (java.sql.SQLException)1 StringReader (org.nutz.lang.stream.StringReader)1