TracingJdbcEventListener extends SimpleJdbcEventListener { @Override public void onAfterAnyExecute(StatementInformation info, long elapsed, SQLException e) { Span span = ThreadLocalSpan.CURRENT_TRACER.remove(); if (span == null || span.isNoop()) return; if (e != null) { span.error(e); span.tag("error", Integer.toString(e.getErrorCode())); } span.finish(); } TracingJdbcEventListener(@Nullable String remoteServiceName, boolean includeParameterValues,
    P6LogLoadableOptions logOptions); @Override void onBeforeAnyExecute(StatementInformation info); @Override void onAfterAnyExecute(StatementInformation info, long elapsed, SQLException e);  }
@Test public void handleAfterExecute_without_beforeExecute_getting_called() { ScopedSpan parent = tracing.tracer().startScopedSpan("test"); try { TracingJdbcEventListener listener = new TracingJdbcEventListener("", false, logOptions); listener.onAfterAnyExecute(statementInformation, 1, null); listener.onAfterAnyExecute(statementInformation, 1, null); } finally { parent.finish(); } }