In pom.xml add dependency:

    <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency> </dependencies>

Then in application.properties:

spring.h2.console.enabled=true
spring.h2.console.path=/h2

Now, in the broswer, we can access h2 database though url: localhost:8080/h2

[Spring boot] Integrating with h2 database的更多相关文章

  1. spring boot :error querying database. Cause: java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required

    配置多个数据源启动报错,error querying database. Cause: java.lang.IllegalArgumentException: dataSource or dataSo ...

  2. Spring Boot 笔记 (8) - H2 数据库

    Maven 依赖 <dependency> <groupId>com.h2database</groupId> <artifactId>h2</a ...

  3. Spring Boot: Cannot determine embedded database driver class for database type NONE

    配置启动项时提示如下: 原因是:springboot启动时会自动注入数据源和配置jpa 解决: 1 在@SpringBootApplication中排除其注入 @SpringBootApplicati ...

  4. Spring Boot with H2 Database

    Learn to configure H2 database with Spring boot to create and use an in-memory database in runtime, ...

  5. 2018-08-20 中文代码之Spring Boot集成H2内存数据库

    续前文: 中文代码之Spring Boot添加基本日志, 源码库地址相同. 鉴于此项目中的数据总量不大(即使万条词条也在1MB之内), 当前选择轻量级而且配置简单易于部署的H2内存数据库比较合理. 此 ...

  6. 中文代码之Spring Boot集成H2内存数据库

    续前文: 中文代码之Spring Boot添加基本日志, 源码库地址相同. 鉴于此项目中的数据总量不大(即使万条词条也在1MB之内), 当前选择轻量级而且配置简单易于部署的H2内存数据库比较合理. 此 ...

  7. 在Spring Boot使用H2内存数据库

    文章目录 添加依赖配置 数据库配置 添加初始数据 访问H2数据库 在Spring Boot使用H2内存数据库 在之前的文章中我们有提到在Spring Boot中使用H2内存数据库方便开发和测试.本文我 ...

  8. Spring Boot Reference Guide

    Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch,  ...

  9. Spring Boot自动配置

    Spring Boot自动配置原理 Spring Boot的自动配置注解是@EnableAutoConfiguration, 从上面的@Import的类可以找到下面自动加载自动配置的映射. org.s ...

随机推荐

  1. python--requests_html

    这个模块从名字上也能看出来,是专门用来解析html的,这个和requests的作者是同一人,非常牛逼的一位大佬. 大致读了一下源码,总共一个py文件(但是引用了其他的模块),加上注释总共才700多行, ...

  2. RQNOJ PID379 / 约会计划 -并查集

    PID379 / 约会计划 题目描述 cc是个超级帅哥,口才又好,rp极高(这句话似乎降rp),又非常的幽默,所以很多mm都跟他关系不错.然而,最关键的是,cc能够很好的调解各各妹妹间的关系.mm之间 ...

  3. HDU1009:FatMouse' Trade(初探贪心,wait)

    FatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containi ...

  4. MySQL密码不能登陆问题

        由于种种原因,在进行开发的时候我一直是基于Windows平台,并且以前初学的时候常常重装不同版本的 MySQL数据库.因此长时间不使用后就产生了一些冲突的问题.     简单描述下,今天用以前 ...

  5. centos中pyenv安装

    1.先安装git yum install git -y 2.克隆pyenv到本地 git clone git://github.com/yyuu/pyenv.git .pyenv 或自动安装 curl ...

  6. Java Retry implement

    There are many cases in which you may wish to retry an operation a certain number of times. Examples ...

  7. hdu6127

    hdu6127 题意 二维平面上存在一些点,每个点都有权值,任意两点组成的线段的权值为这两点权值的乘积,选定一条经过原点的直线,问怎样使得它经过的线段的权值之和最大. 分析 题目等价于用一条直线将平面 ...

  8. 洛谷——P1134 阶乘问题

    P1134 阶乘问题 题目描述 也许你早就知道阶乘的含义,N阶乘是由1到N相乘而产生,如: 12! = 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 ...

  9. next_permutatio

    next_permutation的函数声明:#include  <algorithm> bool next_permutation( iterator start, iterator en ...

  10. luogu P1291 [SHOI2002]百事世界杯之旅

    题目链接 luogu P1291 [SHOI2002]百事世界杯之旅 题解 设\(f[k]\)表示还有\(k\)个球员没有收集到的概率 再买一瓶,买到的概率是\(k/n\),买不到的概率是\((n-k ...