码迷,mamicode.com
首页 > 数据库 > 详细

[Spring boot] Integrating with h2 database

时间:2019-01-14 22:02:16      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:work   spring   console   int   tin   framework   ase   tab   depend   

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

标签:work   spring   console   int   tin   framework   ase   tab   depend   

原文地址:https://www.cnblogs.com/Answer1215/p/10269225.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!