public synchronized void close()

in src/main/java/org/apache/commons/dbcp2/BasicDataSource.java [431:449]


    public synchronized void close() throws SQLException {
        if (registeredJmxObjectName != null) {
            registeredJmxObjectName.unregisterMBean();
            registeredJmxObjectName = null;
        }
        closed = true;
        final GenericObjectPool<?> oldPool = connectionPool;
        connectionPool = null;
        dataSource = null;
        try {
            if (oldPool != null) {
                oldPool.close();
            }
        } catch (final RuntimeException e) {
            throw e;
        } catch (final Exception e) {
            throw new SQLException(Utils.getMessage("pool.close.fail"), e);
        }
    }