1

The JPAcontainer tutorial here: https://vaadin.com/download/jpacontainer-tutorial/

Indicates that you need a H2 database driver with JPAcontainer. I don't understand why? - what functionality do you loose from not having H2 as well as JPAcontainer?

Vahid Farahmandian
  • 6,081
  • 7
  • 42
  • 62
Daniel Paczuski Bak
  • 3,720
  • 8
  • 32
  • 78

1 Answers1

5

For the record:

  • H2 is a database that is slim and can be run as server or embedded in your Java application (in-memory). It provides a JDBC driver.
  • JPA is a Java API that provides an interface for object relational mapping (ORM). Implementations, e.g.:
    • Hibernate
    • EclipseLink

Vaadin's JPAContainer is independent from the database and JPA implementation you deploy. It is built upon JPA to implement the Vaadin Container interface. It is somewhat similar to the SQLContainer but uses JPA instead of plain SQLs.

However, you need a database and its JDBC driver to make use of the JPAContainer. Your linked tutorial takes H2 for that, probably because H2 is open source, free and simple.

That said, you can safely replace H2 with your favorite database.

Steffen Harbich
  • 2,639
  • 2
  • 37
  • 71
  • 1
    Similar comment with some additional details on a slighlty different question: [jpa or jdbc - how are they different](http://stackoverflow.com/questions/11881548/jpa-or-jdbc-how-are-they-different). Nonetheless you pretty much summed it all up, +1 – Morfic Jun 28 '16 at 14:28