public static void dropThreadTestDatabase(final boolean isSharedDatabase) {
        final String dbName = getDbNameThreadLocal(isSharedDatabase).get();

        LOGGER.info("dropThreadTestDatabase - isSharedDatabase: {}, testDbConfig: {}, dbName: {}",
                isSharedDatabase,
                NullSafe.get(getDbConfigThreadLocal(isSharedDatabase), ThreadLocal::get, Objects::toIdentityString),
                dbName);

        if (dbName != null) {
            final ConnectionConfig connectionConfig = createConnectionConfig(new CommonDbConfig());
            final ConnectionConfig rootConnectionConfig = createRootConnectionConfig(connectionConfig);

            // Create new db.
            final Properties connectionProps = new Properties();
            connectionProps.put("user", rootConnectionConfig.getUser());
            connectionProps.put("password", rootConnectionConfig.getPassword());

            try (final Connection connection = DriverManager.getConnection(rootConnectionConfig.getUrl(),
                    connectionProps)) {
                try (final Statement statement = connection.createStatement()) {
                    LOGGER.info(LogUtil.inBoxOnNewLine(
                            "Dropping {} test database: {} on thread: {}",
                            (isSharedDatabase
                                    ? "shared"
                                    : "independent"),
                            dbName,
                            Thread.currentThread().getName()));

                    statement.executeUpdate("DROP DATABASE IF EXISTS `" + dbName + "`;");
                    DB_NAMES_IN_USE.remove(dbName);
                    getDbNameThreadLocal(isSharedDatabase).remove();
                    // Clear out the config so a new DB gets built next time if required on this thread
                    getDbConfigThreadLocal(isSharedDatabase).remove();
                }
            } catch (final SQLException e) {
                throw new RuntimeException(e.getMessage(), e);
            }
        } else {
            LOGGER.info("Thread has no database to drop");
        }
    }
Drop the database used by the current thread

@param isSharedDatabase True if you want to drop the current shared database or
                        false if you want to drop the current independent database.
stroom-test-common/src/main/java/stroom/test/common/util/db/DbTestUtil.java