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


jdbc.native-connection

Use eclipselink.jdbc.native-connection to specify if the query requires a native JDBC connection.


Values

Table 4-18 describes this persistence property's values.

Table 4-18 Valid Values for jdbc.native-connection

Value Description

true

Require native connection.

false

(Default) Do not require native connection.



Usage

This may be required for some queries on some server platforms that have DataSource implementations that wrap the JDBC connection in their own proxy. If the query requires custom JDBC access, it may require a native connection.

A ServerPlatform is required to be set as a persistence property to be able to use a native connection. For features that EclipseLink already knows require a native connection, eclipselink.jdbc.native-connection will default to true.


Examples

Example 4-37 Using jdbc.native-connection in a JPA Query

import org.eclipse.persistence.config.HintValues;
 import org.eclipse.persistence.config.QueryHints;
 query.setHint("eclipselink.NATIVE_CONNECTION", "TRUE");


See Also

For more information, see: