Loading
Java Persistence API (JPA) Extensions Reference for EclipseLink, Release 2.4
  Go To Table Of Contents
Contents
 Search
Other Searches
 PDF
PDF
Comments
Comments


target-database

Use the eclipselink.target-database property to specify the database to use, controlling custom operations and SQL generation for the specified database.


Values

Table 5-89 describes this persistence property's values.

Table 5-89 Valid Values for target-database

Value Description

Defined in the TargetDatabase class or a fully qualified class name that extends DatabasePlatform

Specify your database:

  • Attunity

  • Auto (Default): EclipseLink attempts to access the database and the JDBC metadata to determine the target database.

  • Cloudscape

  • Database: Use a generic database, if your target database is not listed and your JDBC driver does not support the metadata required for Auto.

  • DB2

  • DB2Mainframe

  • DBase

  • Derby

  • HSQL

  • Informix

  • JavaDB

  • MaxDB

  • MySQL

  • MySQL4

  • Oracle

  • Oracle10

  • Oracle11

  • Oracle8

  • Oracle9

  • PointBase

  • PostgreSQL

  • SQLAnywhere

  • SQLServer

  • Sybase

  • Symfoware

  • TimesTen



Usage

If eclipselink.validation-only = true, you must cannot use an Auto class name or short name.


Examples

Example 5-93 shows how to use this property in the persistence.xml file.

Example 5-93 Using target-database in persistence.xml

<property name="eclipselink.target-database" value="Oracle"/>

or

<property name="eclipselink.target-database" value="org.eclipse.persistence.platform.database.HSQLPlatform"/>

Example 5-94 shows how to use this property in the persistence.xml file.

Example 5-94 Using target-database in a Property Map

import org.eclipse.persistence.config.TargetDatabase;
import org.eclipse.persistence.config.PersistenceUnitProperties;
propertiesMap.put(PersistenceUnitProperties.TARGET_DATABASE, TargetDatabase.Oracle);


See Also

For more information, see:

Comments powered by Disqus