集成 JPA 与 pureQuery: 让 Java Persistence API 利用 DB2 静态执行
2009-09-29 00:00:00 来源:WEB开发网可以使用以下命令显示 processPureQueryBindFiles 的完整语法:
print AdminTask.help('processPureQueryBindFiles')
清单 3 显示了上面描述的命令和输出。可以看到,在缺省情况下,将创建每个包的四个版本;数字 1 至 4 分别追加到每个包,以区分该包的隔离级别,每个数据库锁定隔离级别对应一个包。
清单 3. 使用命令行工具创建 DB2 包
C:\was70\bin>wsadmin -lang jython
wsadmin>print AdminTask.listPureQueryBindFiles('[-appName JPA_EE_SAMPLE]')
JPA_W_EJB.jar\META-INF\JPASample.pdqxml
wsadmin>print AdminTask.help('processPureQueryBindFiles')
WASX8006I: Detailed help for command: processPureQueryBindFiles
Description: Process the pureQuery bind files that are in an installed application. Bind
static SQL packages in a database. Refer to the information center documentation for the
pureQuery bind utility.
Target object: None
Arguments:
*appName - The name of an installed application that contains the pureQuery bind files
to be processed.
classpath - A list of the paths to the .jar files that contain the pureQuery bind
utility and its dependencies: pdq.jar, pdqmgmt.jar, and db2jcc4.jar or db2jcc.jar.
Use / or \\ as a file separator. Use a blank space to separate the paths for the .jar
files.
*url - The URL for connecting to the database. The format is jdbc:db2://server_name:
port/database_name.
user - The user name for connecting to the database.
password - The password for connecting to the database.
options - Any additional options that are needed by the pureQuery bind utility.
Provide bind options as: -bindoptions "options-string". Refer to the information center
documentation for the pureQuery bind utility.
*files - A list of the names of the pureQuery bind files to be processed. The bind
file path names must be relative to the application .ear file that contains them.
Use / or \\ as a file separator. If you specify multiple file paths, use a blank space
to separate them.
Steps:
None
wsadmin> wsadmin>print AdminTask.processPureQueryBindFiles('[-appName JPA_EE_SAMPLE
-classpath [C:\\pdq.jar C:\\pdqmgmt.jar C:\\db2jcc.jar ] -url jdbc:db2://localhost:50000
/demodb -user db2admin
-password passw0rd -options [-bindoptions "BLOCKING NO"] -files [JPA_W_EJB.jar\\META-INF
\\JPASample
.pdqxml ]]')
IBM Data Studio pureQuery Runtime 1.2 build 1.3.98
Licensed Materials - Property of IBM
5724-U16
(c) Copyright IBM Corp. 2006, 2008 All Rights Reserved.
================================================================================
Package 'Order1' was bound successfully for isolation level UR.
Package 'Order2' was bound successfully for isolation level CS.
Package 'Order3' was bound successfully for isolation level RS.
Package 'Order4' was bound successfully for isolation level RR.
Package 'Custome1' was bound successfully for isolation level UR.
Package 'Custome2' was bound successfully for isolation level CS.
Package 'Custome3' was bound successfully for isolation level RS.
Package 'Custome4' was bound successfully for isolation level RR.
Package 'pkgseq1' was bound successfully for isolation level UR.
Package 'pkgseq2' was bound successfully for isolation level CS.
Package 'pkgseq3' was bound successfully for isolation level RS.
Package 'pkgseq4' was bound successfully for isolation level RR.
Bind completed successfully for the file 'META-INF\JPASample.pdqxml'.
Bind succeeded for <META-INF\JPASample.pdqxml>.
================================================================================
Binding results:
Number of implementation classes and pureQueryXml files for which bind SUCCEEDED: 1
Number of implementation classes and pureQueryXml files for which bind FAILED: 0
ADMA0510I: Results from pureQuery bind processing for JPA_W_EJB.jar\META-INF\JPASample.
pdqxml. Return code: 0 Exception: null
ADMA0509I: The pureQuery bind operation on application JPA_EE_SAMPLE completed
successfully. Exit code: 0
0
wsadmin>
- ››JPA2.0 Join联结查询
- ››集成医疗保健服务,第 2 部分: 使用 Apache Servi...
- ››集成医疗保健服务,第 1 部分: 将 Enterprise Ser...
- ››集成 Rational Software Architect 和 Rational D...
- ››集成 Windows Azure:适用于企业的 Windows Azure...
- ››集成 Flex, Spring, Hibernate 构建应用程序
- ››jpa onetomany
- ››集成 Windows 本地应用到 Eclipse RCP 程序中
- ››集成 DB2 与 Apache Geronimo
- ››JPA 2.0 中的动态类型安全查询
- ››集成 Adobe Flex 和 IBM WebSphere Portal
- ››集成 JPA 与 pureQuery: 让 Java Persistence API...
更多精彩
赞助商链接