Java Persistence API
As shown in the previous chapter, you can store the states of Java objects in a relational database using JDBC. While this approach works and is still widely used, Java Persistence API (JPA) offers another way of doing this. Internally, JPA uses JDBC, however it can create and update database tables and write SQL statements for you. With JPA, changing a database is just a matter of updating a configuration file. It can potentially make your life easier, but there is a learning curve to go through.
This chapter explains what JPA is, what benefits it offers and how to use it. Bear in mind that JPA is a complex technology and this chapter barely touches its surface.
JPA specifies object-relational ...