Spring Boot H2 JdbcTemplate 内存数据库
1.增加依赖com.h2database h2 runtime 2.初始化sql(resources/init.sql) spring.sql.init.schema-locations=classpath:init.sql 3.注入JdbcTemplate @Autowired private JdbcTemplate jdbcTemplate; @GetMapping("/") public String index() { List org.springframework.boot spring-boot-starter-jdbc
spring.h2.console.enabled=true