<<TableOfContents(2)>>
= H2 =
The main features of [[https://www.h2database.com/html/main.html|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 ===
{{{#!highlight xml
<dependency>
    <groupId>com.h2database</groupId>
    <artifactId>h2</artifactId>
    <version>2.3.232</version>
</dependency>
}}}

=== application.yaml ===
{{{#!highlight yaml
spring:
  datasource:
    url: jdbc:h2:file:./mydb
    username: xx
    password: xx
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: false
}}}

== Use H2 database ==
{{{#!highlight sh
java -cp h2-2.3.232.jar org.h2.tools.Shell -url "jdbc:h2:file:./chucknorrisdb" -user "xx" -password "xx"
show tables;
select * from tablex;
exit
}}}