Configure JPA to work in your environment
You have developed your applications to work with Java™ Persistence API (JPA) and now you must configure your JPA applications to work in your environment.
About this task
Procedure
- Configure your data sources through the administrative console. See the topic, Configuring a JDBC provider and data source.
- Specify the Java Naming and Directory Interface (JNDI)
names for the <jta-data-source> and
<non-jta-data-source> elements. For example to use JNDI lookup:
<jta-data-source>jdbc/myJTADataSource</jta-data-source> <non-jta-data-source>jdbc/myNonJTADataSource</non-jta-data-source>
If you use the component name space method (for example, java:comp/env) for data source retrieval, ensure that your application defines these resource references so that you can use these JNDI names to access the data source. This component name space configuration provides more flexibility if you must alter the configuration for the data source. Otherwise, the standard, direct JNDI is used as the data source name. For more information about using the JNDI interface, see the topic, Developing applications that use JNDI. For example, the persistence.xml file would have an entry like the following:
OR<jta-data-source>java:comp/env/jdbc/DataSourceJNDI</jta-data-source>
<jta-data-source>jdbc/DataSourceJNDI</jta-data-source>
- Configure persistence provider support in the application server.
次主題
配置 JDBC 提供者和資料來源
如果要存取關聯式資料庫,應用程式會使用您配置給應用程式伺服器的「Java 資料庫連線功能 (JDBC)」驅動程式和資料來源。Configuring the default JTA and non-JTA data source JNDI names
The Java Transaction API (JTA) and non-JTA data sources to be used for an application can be specified through the <jta-data-source> and <non-jta-data-source> elements of the persistence.xml file within an Enterprise JavaBeans (EJB) module.Associating persistence providers and data sources
Java Persistence API (JPA) applications specify the underlying data source that is used by the persistence provider to access the database.WebSphere Application Server persistence providers
Persistence providers are implementations of the Java Persistence API (JPA) specification and can be deployed in the Java EE compliant application server that supports JPA persistence.wsjpaversion command
Use this command line tool to find out information about the installed version of the Java Persistence API (JPA) 2.0 specification provider, WSJPA/OpenJPA, for WebSphere Application Server.eclversion command
Use this command-line tool to find out information about the installed version of the Java Persistence API (JPA) 2.1 specification provider, Eclipselink, for the product.Identifying and modifying the JPA specification level
Newly created profiles default to the Java Persistence API (JPA) 2.1 specification. You can run AdminTask wsadmin commands to list JPA specifications that are supported by the product and to change the JPA specification that is used by a server, server cluster, or servers that are members of a cluster.Configuring WSJPA FastPath
The Java Persistence API (JPA) is a very flexible specification that provides guidelines on how implementers are to convert relational data to Java object form. Due to the flexible nature of this API, a large amount of work is completed at runtime by the API provider to determine how to correctly load relational data into object form. This flexibility results in a runtime that, under certain circumstances, must continually run redundant code to ensure that data is loaded properly. By giving up some of this flexibility, the WSJPA FastPath optimization attempts to skip much of this redundant code and generates highly optimized code that interacts directly with the JDBC layer. This optimization translates to improved performance.IBM Optim pureQuery Runtime
IBM Optim pureQuery Runtime provides Java Persistence API (JPA) with an alternative way to access a database. PureQuery supports static Structured Query Language (SQL). PureQuery is only supported by OpenJPA and WSJPA persistence providers.配置 JDBC 提供者和資料來源
如果要存取關聯式資料庫,應用程式會使用您配置給應用程式伺服器的「Java 資料庫連線功能 (JDBC)」驅動程式和資料來源。Configuring the default JTA and non-JTA data source JNDI names
The Java Transaction API (JTA) and non-JTA data sources to be used for an application can be specified through the <jta-data-source> and <non-jta-data-source> elements of the persistence.xml file within an Enterprise JavaBeans (EJB) module.Associating persistence providers and data sources
Java Persistence API (JPA) applications specify the underlying data source that is used by the persistence provider to access the database.WebSphere Application Server persistence providers
Persistence providers are implementations of the Java Persistence API (JPA) specification and can be deployed in the Java EE compliant application server that supports JPA persistence.wsjpaversion command
Use this command line tool to find out information about the installed version of the Java Persistence API (JPA) 2.0 specification provider, WSJPA/OpenJPA, for WebSphere Application Server.eclversion command
Use this command-line tool to find out information about the installed version of the Java Persistence API (JPA) 2.1 specification provider, Eclipselink, for the product.Identifying and modifying the JPA specification level
Newly created profiles default to the Java Persistence API (JPA) 2.1 specification. You can run AdminTask wsadmin commands to list JPA specifications that are supported by the product and to change the JPA specification that is used by a server, server cluster, or servers that are members of a cluster.Configuring WSJPA FastPath
The Java Persistence API (JPA) is a very flexible specification that provides guidelines on how implementers are to convert relational data to Java object form. Due to the flexible nature of this API, a large amount of work is completed at runtime by the API provider to determine how to correctly load relational data into object form. This flexibility results in a runtime that, under certain circumstances, must continually run redundant code to ensure that data is loaded properly. By giving up some of this flexibility, the WSJPA FastPath optimization attempts to skip much of this redundant code and generates highly optimized code that interacts directly with the JDBC layer. This optimization translates to improved performance.IBM Optim pureQuery Runtime
IBM Optim pureQuery Runtime provides Java Persistence API (JPA) with an alternative way to access a database. PureQuery supports static Structured Query Language (SQL). PureQuery is only supported by OpenJPA and WSJPA persistence providers.
Related tasks:
Related reference:


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tejb_configjpa
檔名:tejb_configjpa.html