shardingsphere-proxy/shardingsphere-proxy-backend/src/main/java/org/apache/shardingsphere/proxy/backend/communication/jdbc/connection/JDBCBackendConnection.java
/**
     * Close database communication engines.
     *
     * @param includeInUse include engines in use
     * @return SQL exception when engine close
     */
Close database communication engines.
@param includeInUse include engines in use
@return SQL exception when engine close
Close database communication engines . @param includeInUse include engines in use @return SQL exception when engine close
public synchronized Collection<SQLException> closeDatabaseCommunicationEngines(final boolean includeInUse) {
        Collection<SQLException> result = new LinkedList<>();
        for (DatabaseCommunicationEngine each : databaseCommunicationEngines) {
            if (!includeInUse && inUseDatabaseCommunicationEngines.contains(each)) {
                continue;
            }
            try {
                each.close();
            } catch (final SQLException ex) {
                result.add(ex);
            }
        }
        if (includeInUse) {
            inUseDatabaseCommunicationEngines.clear();
        }
        databaseCommunicationEngines.retainAll(inUseDatabaseCommunicationEngines);
        return result;
    }
public synchronized Collection < SQLException > closeDatabaseCommunicationEngines ( final boolean includeInUse ) { Collection < SQLException > result = new LinkedList < > ( ) ; for ( DatabaseCommunicationEngine each : databaseCommunicationEngines ) { if ( ! includeInUse && inUseDatabaseCommunicationEngines . contains ( each ) ) { continue ; } try { each . close ( ) ; } catch ( final SQLException ex ) { result . add ( ex ) ; } } if ( includeInUse ) { inUseDatabaseCommunicationEngines . clear ( ) ; } databaseCommunicationEngines . retainAll ( inUseDatabaseCommunicationEngines ) ; return result ; }
Close database communication engines.
Close database communication engines .