whycxzp
2022-01-12 e9f7312050bfefbd1afa6921a7ddd854fb4aff8f
src/main/java/com/whyc/Application.java
@@ -15,6 +15,8 @@
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import static java.lang.Thread.sleep;
/**
 * @Description : 启动类
 * @date 2020/10/15
@@ -30,6 +32,17 @@
        ApplicationContext applicationContext = SpringUtil.getApplicationContext();
        ClearTableService service = (ClearTableService) applicationContext.getBean("clearTableService");
        service.clearTable();
        service.dropTable();
        service.clearColumn();
        int sleepSeconds = 3;
        System.out.println("清除/删除操作完成,"+sleepSeconds+"秒后自动退出程序...");
        try {
            sleep(sleepSeconds*1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("程序终止");
        System.exit(1);
    }
}