public synchronized void close()

in src/main/java/org/apache/commons/dbcp2/PoolingConnection.java [110:134]


    public synchronized void close() throws SQLException {
        try {
            if (null != stmtPool) {
                final KeyedObjectPool<PStmtKey, DelegatingPreparedStatement> oldPool = stmtPool;
                stmtPool = null;
                try {
                    oldPool.close();
                } catch (final RuntimeException e) {
                    throw e;
                } catch (final Exception e) {
                    throw new SQLException("Cannot close connection", e);
                }
            }
        } finally {
            try {
                @SuppressWarnings("resource")
                final Connection delegateInternal = getDelegateInternal();
                if (delegateInternal != null) {
                    delegateInternal.close();
                }
            } finally {
                setClosedInternal(true);
            }
        }
    }