use of com.alibaba.druid.pool.ExceptionSorter in project druid by alibaba.
the class DruidDataSourceTest_exceptionSorter method setUp.
protected void setUp() throws Exception {
dataSource = new DruidDataSource();
dataSource.setUrl("jdbc:mock:xxx");
dataSource.setTestOnBorrow(false);
dataSource.setRemoveAbandoned(true);
dataSource.setDriver(new MockDriver() {
public ResultSet executeQuery(MockStatementBase stmt, String sql) throws SQLException {
throw new SQLException();
}
});
dataSource.setExceptionSorter(new ExceptionSorter() {
@Override
public boolean isExceptionFatal(SQLException e) {
return true;
}
@Override
public void configFromProperties(Properties properties) {
}
});
}
Aggregations