public static void delete (String feedId, DataSource dataSource) throws SQLException, InvalidNamespaceException {
        LOG.info("Deleting all tables (dropping schema) for {} feed namespace.", feedId);
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
            ensureValidNamespace(feedId);
            // Mark entry in feeds table as deleted.
            String deleteFeedEntrySql = "update feeds set deleted = true where namespace = ?";
            PreparedStatement deleteFeedStatement = connection.prepareStatement(deleteFeedEntrySql);
            deleteFeedStatement.setString(1, feedId);
            deleteFeedStatement.executeUpdate();
            // Drop all tables bearing the feedId namespace.
            // Note: It does not appear to be possible to use prepared statements with "drop schema."
            String dropSchemaSql = String.format("DROP SCHEMA %s CASCADE", feedId);
            Statement statement = connection.createStatement();
            statement.executeUpdate(dropSchemaSql);
            // Commit the changes.
            connection.commit();
        } catch (InvalidNamespaceException | SQLException e) {
            LOG.error(String.format("Could not drop feed for namespace %s", feedId), e);
            throw e;
        } finally {
            if (connection != null) DbUtils.closeQuietly(connection);
        }
    }
public static void delete (String feedId, DataSource dataSource) throws SQLException, InvalidNamespaceException {
        LOG.info("Deleting all tables (dropping schema) for {} feed namespace.", feedId);
        Connection connection = null;
        try {
            connection = dataSource.getConnection();
            ensureValidNamespace(feedId);
            
            String deleteFeedEntrySql = "update feeds set deleted = true where namespace = ?";
            PreparedStatement deleteFeedStatement = connection.prepareStatement(deleteFeedEntrySql);
            deleteFeedStatement.setString(1, feedId);
            deleteFeedStatement.executeUpdate();
            
            
            String dropSchemaSql = String.format("DROP SCHEMA %s CASCADE", feedId);
            Statement statement = connection.createStatement();
            statement.executeUpdate(dropSchemaSql);
            
            connection.commit();
        } catch (InvalidNamespaceException | SQLException e) {
            LOG.error(String.format("Could not drop feed for namespace %s", feedId), e);
            throw e;
        } finally {
            if (connection != null) DbUtils.closeQuietly(connection);
        }
    }
public static void delete ( String feedId , DataSource dataSource ) throws SQLException , InvalidNamespaceException { LOG . info ( "Deleting all tables (dropping schema) for {} feed namespace." , feedId ) ; Connection connection = null ; try { connection = dataSource . getConnection ( ) ; ensureValidNamespace ( feedId ) ; // Mark entry in feeds table as deleted. String deleteFeedEntrySql = "update feeds set deleted = true where namespace = ?" ; PreparedStatement deleteFeedStatement = connection . prepareStatement ( deleteFeedEntrySql ) ; deleteFeedStatement . setString ( 1 , feedId ) ; deleteFeedStatement . executeUpdate ( ) ; // Drop all tables bearing the feedId namespace. // Note: It does not appear to be possible to use prepared statements with "drop schema." String dropSchemaSql = String . format ( "DROP SCHEMA %s CASCADE" , feedId ) ; Statement statement = connection . createStatement ( ) ; statement . executeUpdate ( dropSchemaSql ) ; // Commit the changes. connection . commit ( ) ; } catch ( InvalidNamespaceException | SQLException e ) { LOG . error ( String . format ( "Could not drop feed for namespace %s" , feedId ) , e ) ; throw e ; } finally { if ( connection != null ) DbUtils . closeQuietly ( connection ) ; } }
Deletes all tables for the specified feed. Simply put, this is a "drop schema" SQL statement called on the feed's
namespace.
Deletes all tables for the specified feed . Simply put this is a drop schema SQL statement called on the feed s namespace .