// listeners have been triggered.
final int[] counters = new int[4];
// Add some listeners that add another listener
for (int i = 0; i < 5; i++) {
StatementEventListener close = new StatementEventListener() {
public void statementClosed(StatementEvent event) {
counters[0]++;
pooledConnection.addStatementEventListener(
new StatementEventListener() {
public void statementClosed(StatementEvent e) {
counters[2]++;
}
public void statementErrorOccurred(StatementEvent e) {
counters[2]++;
}
});
}
public void statementErrorOccurred(StatementEvent event) {
}
};
pooledConnection.addStatementEventListener(close);
StatementEventListener error = new StatementEventListener() {
public void statementClosed(StatementEvent event) {
}
public void statementErrorOccurred(StatementEvent event) {
counters[1]++;
pooledConnection.addStatementEventListener(
new StatementEventListener() {
public void statementClosed(StatementEvent e) {
counters[3]++;
}
public void statementErrorOccurred(StatementEvent e) {
counters[3]++;