This article provides all the information you need to use the Progress DataDirect JDBC drivers with these Java technologies. Java Platform, Enterprise Edition (Java EE) is the industry standard for developing portable, robust, scalable and secure server-side Java applications. Java EE provides web services, component model, management, and communications APIs that make it the industry standard for implementing enterprise-class service-oriented architecture (SOA) and next-generation web applications.
The Enterprise JavaBeans (EJB) architecture is a component-based architecture for development and deployment of component-based distributed applications. Applications written using Enterprise JavaBeans are scalable, transactional, and multi-user secure. These applications may be written once, and then deployed on any server platform that supports the EJB specification.
The Java Persistence API (JPA) provides a POJO (plain old Java Object) persistence model for object-relational mapping. It contains a full object/relational mapping specification supporting the use of Java language metadata annotations and/or XML descriptors to define the mapping between Java objects and a relational database. It supports a rich, SQL-like query language (which is a significant extension upon EJB Query Language) for both static and dynamic queries. It also supports the use of pluggable persistence providers.
The JPA specification was introduced by Sun as a means to combine the best ideas from many sources in the new persistence API and create a lightweight, easy to use API which is integrated into any Java EE 5 application server.
JPA provides a standardized means for mapping relational data to Java objects, while also handling the way these objects are stored in the database and removing the need to code directly to the JDBC API.
Adding support for JPA is achieved by defining the persistence.xml file in the META-INF directory within your application package. The persistence.xml file is the standard configuration file in JPA. In this file you define a uniquely named persistence unit which will be used by the EntityManager defined in your Entity Bean code. The provider attribute specifies the underlying implementation of the JPA EntityManager. In JBoss AS, the default and only supported / recommended JPA provider is Hibernate. The jta-data-source points to the JNDI name of the database connection to which this persistence unit maps.
For more details on the persistence.xml file, please refer to Chapter 6 of the EJB 3.0 Java Persistence API Specification
Sample persistence.xml file for this example: