The Java Persistence API (JPA) is a specification for the set of interfaces to store, query, and update data stored in a database. JPA can be implemented by an Object Relational Mapping (ORM) which maps classes to a database table. JPA’s use of ORM allows developers to interact with the database without having to write database queries.
H2 is a type of database engine in Java. It is embedded into the application and supports in-memory or disk-based persistence.