@Override public Connection getConnection() throws SQLException { final long start = System.nanoTime(); final Connection conn; final JdbcEventListener jdbcEventListener = this.jdbcEventListenerFactory.createJdbcEventListener(); final ConnectionInformation connectionInformation = ConnectionInformation.fromPooledConnection(passthru); jdbcEventListener.onBeforeGetConnection(connectionInformation); try { conn = passthru.getConnection(); connectionInformation.setConnection(conn); connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, null); } catch (SQLException e) { connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, e); throw e; } return ConnectionWrapper.wrap(conn, jdbcEventListener, connectionInformation); }
@Override public Connection getConnection() throws SQLException { final long start = System.nanoTime(); final Connection conn; final JdbcEventListener jdbcEventListener = this.jdbcEventListenerFactory.createJdbcEventListener(); final ConnectionInformation connectionInformation = ConnectionInformation.fromPooledConnection(passthru); jdbcEventListener.onBeforeGetConnection(connectionInformation); try { conn = passthru.getConnection(); connectionInformation.setConnection(conn); connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, null); } catch (SQLException e) { connectionInformation.setTimeToGetConnectionNs(System.nanoTime() - start); jdbcEventListener.onAfterGetConnection(connectionInformation, e); throw e; } return ConnectionWrapper.wrap(conn, jdbcEventListener, connectionInformation); }