WEB开发网
开发学院软件开发Java 集成 JPA 与 pureQuery: 让 Java Persistence API... 阅读

集成 JPA 与 pureQuery: 让 Java Persistence API 利用 DB2 静态执行

 2009-09-29 00:00:00 来源:WEB开发网   
核心提示: 可以使用以下命令显示 processPureQueryBindFiles 的完整语法: print AdminTask.help('processPureQueryBindFiles')清单 3 显示了上面描述的命令和输出,可以看到,集成 JPA 与 pureQuery: 让 J

可以使用以下命令显示 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>

上一页  1 2 3 4 5 6 7 8 9 10  下一页

Tags:集成 JPA pureQuery

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接