use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class WallFilter method preparedStatement_executeQuery.
@Override
public ResultSetProxy preparedStatement_executeQuery(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
try {
ResultSetProxy resultSetProxy = chain.preparedStatement_executeQuery(statement);
preprocessResultSet(resultSetProxy);
return resultSetProxy;
} catch (SQLException ex) {
incrementExecuteErrorCount(statement);
throw ex;
}
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class WallFilter method statement_executeQuery.
@Override
public ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql) throws SQLException {
createWallContext(statement);
try {
sql = check(sql);
ResultSetProxy resultSetProxy = chain.statement_executeQuery(statement, sql);
preprocessResultSet(resultSetProxy);
return resultSetProxy;
} catch (SQLException ex) {
incrementExecuteErrorCount();
throw ex;
} finally {
WallContext.clearContext();
}
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterExecErrorTest 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 ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql) throws SQLException {
throw new SQLException();
}
@Override
public ResultSetProxy preparedStatement_executeQuery(FilterChain chain, PreparedStatementProxy statement) throws SQLException {
throw new SQLException();
}
});
dataSource.init();
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterOpenBlobCountTest 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 Blob resultSet_getBlob(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new MockBlob();
}
@Override
public Blob resultSet_getBlob(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new MockBlob();
}
});
dataSource.init();
}
use of com.alibaba.druid.proxy.jdbc.ResultSetProxy in project druid by alibaba.
the class StatFilterOpenBlobCountTest2 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 Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnLabel) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, int columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new MockBlob();
}
@Override
public Object resultSet_getObject(FilterChain chain, ResultSetProxy result, String columnIndex, java.util.Map<String, Class<?>> map) throws SQLException {
return new MockBlob();
}
});
dataSource.init();
}
Aggregations