Java Persistence/Databases
Most JPA providers will support any JDBC and SQL compliant database. Some JPA features requires database specific support.
JPA functionality that may be database specific include:
- schema creation
- pagination
- pessimistic locking
- generated ids and sequencing
- update and delete queries
- outer joins
- functions
- lobs
Depending on what database and JPA provider you use, these features may or may not work. Most JPA providers have a persistence unit property (persistence.xml) to specify the database platform the persistence unit will be accessing, and have built in support for a large set of database platforms. Some JPA providers will auto-detect the database platform, so setting the property is not required. Many JPA providers have extended support for various databases to handle different data types or handle functionality specific to the database platform.
Most JPA providers provide support for most popular databases such as, Oracle, MySQL, PostgreSQL, DB2, SQL Server.
- TopLink / EclipseLink : Have extended support for most databases, see FAQ, and have extended support for the Oracle database, see FAQ. EclipseLink will auto detect the database platform so no persistence property is required, by can be set using
"eclipselink.target-database".
[edit] EIS, NoSQL, and Non-relational Data Sources
The JPA specification only defines relational database access, there are other types of databases, and other types of data.
Other data sources include:
- Hierarchical databases, VSAM, and other legacy databases
- CICS, Tuxedo, MQ Series, and other transactional and messaging systems
- Application database, SAP, Oracle Apps and other apps data
- XML databases, webservices, and other XML services
- Data interchange and B2B services
- Amazon S3 and Google BigTable and other application engines
- Object databases, and object relational data types
- JSON, LDAP, Excel, and various other data formats and services
Many of these data services, or third parties provide JDBC drivers to access these types of data. Other Java specification such as JCA, JMS, or web services can be used to access these types of data. Some JPA providers also support accessing these types of data using JPA.
- TopLink / EclipseLink : Have integrated EIS support through allowing mapping and persistence through the JCA and JMS specifications. Also support for XML, JAXB and SDO is an integrated part of the JPA product. Mapping to object relational data types are also supported.