[Spring boot] Integrating with h2 database
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的更多相关文章
- 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 ...
- Spring Boot 笔记 (8) - H2 数据库
Maven 依赖 <dependency> <groupId>com.h2database</groupId> <artifactId>h2</a ...
- Spring Boot: Cannot determine embedded database driver class for database type NONE
配置启动项时提示如下: 原因是:springboot启动时会自动注入数据源和配置jpa 解决: 1 在@SpringBootApplication中排除其注入 @SpringBootApplicati ...
- Spring Boot with H2 Database
Learn to configure H2 database with Spring boot to create and use an in-memory database in runtime, ...
- 2018-08-20 中文代码之Spring Boot集成H2内存数据库
续前文: 中文代码之Spring Boot添加基本日志, 源码库地址相同. 鉴于此项目中的数据总量不大(即使万条词条也在1MB之内), 当前选择轻量级而且配置简单易于部署的H2内存数据库比较合理. 此 ...
- 中文代码之Spring Boot集成H2内存数据库
续前文: 中文代码之Spring Boot添加基本日志, 源码库地址相同. 鉴于此项目中的数据总量不大(即使万条词条也在1MB之内), 当前选择轻量级而且配置简单易于部署的H2内存数据库比较合理. 此 ...
- 在Spring Boot使用H2内存数据库
文章目录 添加依赖配置 数据库配置 添加初始数据 访问H2数据库 在Spring Boot使用H2内存数据库 在之前的文章中我们有提到在Spring Boot中使用H2内存数据库方便开发和测试.本文我 ...
- Spring Boot Reference Guide
Spring Boot Reference Guide Authors Phillip Webb, Dave Syer, Josh Long, Stéphane Nicoll, Rob Winch, ...
- Spring Boot自动配置
Spring Boot自动配置原理 Spring Boot的自动配置注解是@EnableAutoConfiguration, 从上面的@Import的类可以找到下面自动加载自动配置的映射. org.s ...
随机推荐
- 配置iptables,把80端口转到8080
在Linux的下面部署了tomcat,为了安全我们使用非root用户进行启动,但是在域名绑定时无法直接访问80端口号.众所周知,在unix下,非root用户不能监听1024以上的端口号,这个tomca ...
- Android系统是一个基于BInder通信的C/S架构
Android系统基本上可以看作是一个基于Binder通信的C/S架构.他有服务器端和客户端.比如自己开发一个程序,肯定是基于Activity的而Activity就是作为客户端,他的服务器端就是Act ...
- python变现实现新浪微博登陆
新浪微博的登陆现在是越来越那个了,以前的模拟浏览器登陆新浪微博貌似也越来不管用了 登陆信息由以前的form变成了现在javascript,javascript的加载居然用了一个javascript的函 ...
- CSDN博客排名记录
截止今天,在CSDN的博客排名终于从"千里之外"变成具体的排名数字了.根据CSDN的规则,只有排名在20000以内才能显示具体的排名.从2015年5月11日开始写了第一篇博客.后来 ...
- 安装并启用rabbitmq服务器
1.确保Erlang已经安装 2.安装rabbitmq服务器 [root@bogon yum.repos.d]# rpm --import https://dl.bintray.com/rabbitm ...
- c语言,warning: return type of 'main' is not `int'怎么解决?
////警告可以忽略,但如果严格点的话 #include<stdio.h> #include<math.h> int main(int argc, char *arg[]) ...
- Redis数据类型的常用API以及使用场景
一.通用命令 1.keys 遍历出所有的key 一般不在生产环境使用 2.dbsize key的总数 3.exists key 4.del key 删除指定key-value 5.expire k ...
- Django remedy a security issue refer dos attack
Today the Django team is issuing multiple releases -- Django 1.4.8, Django 1.5.4, and Django 1.6 bet ...
- 如何通过chrome的开发者工具查找新浪评论数据在哪个文件
1.打开开发者工具(ctrl+shift+i) 2.打开搜索(Esc) 示例:http://comment5.news.sina.com.cn/page/info?format=js&chan ...
- Hibernate 配置文件与实体类
今天在配置Hibernate的时候碰到了这样的错误: MappingException: Unknown entity 仔细想了一下,应该是因为我在开始时使用了 Configuration confi ...