Chapter 3. Changing Provider

Table of Contents

3.1. Changing Persistence Provider
3.2. Available Persistence Provider

This chapter describes how to change the basic provider of JEUS.

3.1. Changing Persistence Provider

To use other providers, besides the basic provider supported by JEUS, use the settings provided by the JPA specifications.

Copy the necessary libraries to the JEUS_HOME/lib/application directory or package each application, and set the <provider> property in the persistence. xml file to the class name of the provider. Corresponding persistence units will use the specified provider.

Refer to the corresponding document for configuration, since the provider class name and related properties differ by the provider. For example, to use Hibernate, set as follows:

[Example 3.1] Changing Persistence Provider

<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence">
  <persistence-unit name="em">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <jta-data-source>jdbc/MyDB</jta-data-source>
    <properties>
      <!-- add Hibernate properties here -->
    </properties>
  </persistence-unit>
</persistence>


Provider can be changed by persistence unit as shown in the previous example, or the default provider of JEUS can be used. If the system property jeus.persistence.defaultProvider is set to another provider class name when JEUS starts, all persistence units that do not set their own provider will use the default provider.

Note

Refer to "JEUS Server Guide" and "JEUS Reference Guide" to learn how to configure JEUS system properties.

3.2. Available Persistence Provider

Refer to the following sites for information about other persistence providers: