Spring Boot 不启用数据库连接:
package com.wanma; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; import org.springframework.scheduling.annotation.EnableAsync; @EnableAsync @SpringBootApplication(exclude = { DataSourceAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class }) public class RunApp { public static void main(String[] args) { SpringApplication.run(RunApp.class, args); } }