The majority of applications need to persist (or store) data during their lifecycle. There are many ways of doing this with an application written in Java.
To give a guide, here are a few important consideration points when choosing a persistence layer for your application.
Feature | JDBC | JDO | JPA | EJB2 | Custom ORM |
---|---|---|---|---|---|
Standards-Driven | ![]() |
![]() |
![]() |
![]() |
![]() |
Choice of datastores | ![]() |
![]() |
![]() |
![]() |
![]() |
Support POJOs | ![]() |
![]() |
![]() |
![]() |
![]() |
Usable in J2SE | ![]() |
![]() |
![]() |
![]() |
![]() |
Usable in J2EE | ![]() |
![]() |
![]() |
![]() |
![]() |
Out of box implementation (1) | ![]() |
![]() |
![]() |
![]() |
![]() |
Simple to unit test | ![]() |
![]() |
![]() |
![]() |
![]() |
Dynamic queries | ![]() |
![]() |
![]() |
![]() |
![]() |
Comprehensive ORM | ![]() |
![]() |
![]() |
![]() |
![]() |
Primary Key generation | ![]() |
![]() |
![]() |
![]() |
![]() |
Supports inherited objects | ![]() |
![]() |
![]() |
![]() |
![]() |
Schema Creation | ![]() |
![]() |
![]() |
![]() |
![]() |
Existing schema | ![]() |
![]() |
![]() |
![]() |
![]() |