H2
The main features of H2 are:
- Very fast, open source, JDBC API
- Embedded and server modes; in-memory databases
- Browser based Console application
- Small footprint: around 2.5 MB jar file size
SpringBoot
pom.xml
1 <dependency>
2 <groupId>com.h2database</groupId>
3 <artifactId>h2</artifactId>
4 <version>2.3.232</version>
5 </dependency>
application.yaml
1 spring:
2 datasource:
3 url: jdbc:h2:file:./mydb
4 username: xx
5 password: xx
6 jpa:
7 hibernate:
8 ddl-auto: update
9 show-sql: false
Use H2 database
1 java -cp h2-2.3.232.jar org.h2.tools.Shell -url "jdbc:h2:file:./chucknorrisdb" -user "xx" -password "xx"
2 show tables;
3 select * from tablex;
4 exit
H2 (last edited 2025-01-15 14:54:40 by vitor)