What is h2 embedded database?
Category:
technology and computing
databases
H2 is an open-source lightweight Java database. It can be embedded in Java applications or run in the client-server mode. Mainly, H2 database can be configured to run as inmemory database, which means that data will not persist on the disk.
Considering this, how do I use h2 embedded database?
To use it in embedded mode, you need to:
- Add the h2*. jar to the classpath (H2 does not have any dependencies)
- Use the JDBC driver class: org. h2. Driver.
- The database URL jdbc:h2:~/test opens the database test in your user home directory.
- A new database is automatically created.
Simply so, how does h2 database work?
Using H2
- H2 is open source, free to use and distribute.
- Download: jar, installer (Windows), zip.
- To start the H2 Console tool, double click the jar file, or run java -jar h2*. jar , h2. bat , or h2.sh .
- A new database is automatically created by default.
- Closing the last connection closes the database.
H2 is an open source database and is written in Java. It is very fast and of very small size. It is primarily used as an in-memory database which means it stores the data in memory and will not persist data on disk.