Requirements for running pureQuery utilities

You must configure your Java environment to run the Java pureQuery Runtime utilities. To configure your environment you can set environment variables or specify command line options.

Ensure that your system meets the hardware and software requirements. See System requirements for InfoSphere® Optim™ pureQuery Runtime.

The pureQuery Runtime utilities are Java commands. To run the commands, the JAR files pdq.jar, and pdqmgmt.jar must be on your classpath.

If you are running the Configure utility and specify either the -replaceLocations or the -replaceSchemas option, the JAR file pdqsqlparser.jar must also be on your classpath.

For utilities that connect to a database, you must also have the database driver JAR files on your classpath. For example, the files for IBM® Data Server Driver for JDBC and SQLJ are db2jcc_license_cu.jar and db2jcc.jar. You use these driver files to connect to DB2® for Linux, UNIX, and Windows. For example the GeneratePureQueryXml, ManageRepository and StaticBinder utilities require a connection to a database.

To add the JAR files to your classpath, you can modify the CLASSPATH environment variable or use the Java -cp option. For information about the CLASSPATH environment variable and the -cp option, see your Java documentation.

Tip: The InfoSphere Optim pureQuery Runtime installation and the IBM Data Studio installation contain sample scripts that run pureQuery Runtime utilities. Both installations contain scripts that can be used to manage an SQL Management Repository that is created in a database. The Data Studio installation contains other scripts that generate implementation classes for Java interfaces that declare annotated methods. The pureQuery Runtime scripts are installed in the directory pureQuery-install\IBM_Data_Tools\sample_repository_scripts. The Data Studio scripts are installed in the directory Data Studio install\dsdev\bin.
This example sets the CLASSPATH environment variable and runs the pureQuery Configure utility. The command configures the pureQueryXML file mytestsql.pdqxml.
set CLASSPATH=C:\pureQuery\pdq.jar;C:\pureQuery\pdqmgmt.jar;.;%CLASSPATH%;

java com.ibm.pdq.tools.Configure -pureQueryXml mytestsql.pdqxml -rootPkgName MYTEST -validateXml TRUE
This example runs the pureQuery ManageRepository utility to create a repository from a batch file. Before running the utility, the environment variables CLASSPATH and pqconnect are set. The CLASSPATH lists the pureQuery Runtime JAR files and the IBM Data Server Driver for JDBC and SQLJ JAR files. The value of the variable pqconnect is the set of the ManageRepository options that specify the connection to the database.
set CLASSPATH=C:\pureQuery\pdq.jar;C:\pureQuery\pdqmgmt.jar;db2jcc_license_cu.jar;db2jcc.jar;.;%CLASSPATH%;
set pqconnect= -repositoryURL jdbc:db2://localhost:50000/SAMPLE -repositoryDriverClass com.ibm.db2.jcc.DB2Driver

java com.ibm.pdq.tools.ManageRepository %pqconnect% 
   -repositoryUsername "test" -repositoryPassword "testpwd" 
   -create repository -repositoryType pureQueryOnly 

The ManageRepository command is on multiple lines for readability. In the batch file, the command on a single line.


Feedback