use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterOpenInputStreamCountTest2 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.InputStream resultSet_getAsciiStream(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new ByteArrayInputStream(new byte[0]);
}
@Override
public java.io.InputStream resultSet_getAsciiStream(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new ByteArrayInputStream(new byte[0]);
}
});
dataSource.init();
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy 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();
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterReadBytesLengthTest 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 byte[] resultSet_getBytes(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new byte[6];
}
@Override
public byte[] resultSet_getBytes(FilterChain chain, ResultSetProxy result, String columnIndex) throws SQLException {
return new byte[7];
}
});
dataSource.init();
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterReadStringLengthTest 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 String resultSet_getString(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return "123456";
}
@Override
public String resultSet_getString(FilterChain chain, ResultSetProxy result, String columnIndex) throws SQLException {
return "1234567";
}
});
dataSource.init();
}
Aggregations