(1) >>-java--com.ibm.pdq.tools.StaticBinder-------------------------> (2) >-------- -url--jdbc--:--db2--:--//--server--+---------+--/--database--> '-:--port-' >-- -username--user-ID-- -password--password--------------------> .---------------------------------------------. V | >-- -pureQueryXml----+-pureQueryXML-file-----------------------+-+--> '-pureQueryXML-file--:--base-package-name-' >--+------------------------------------------------------------------------+--> | (3) | +-| DBRM options |-------------------------------------------------------+ +- -bindOptions-- -"--bind-options--"--+-------------------------------+-+ | '- -verifyPackages--+-DETAIL--+-' | | '-SUMMARY-' | '- -verifyPackages--+-DETAIL--+------------------------------------------' '-SUMMARY-' >--+-----------------------------+--+----------------+----------> | .-FALSE-. | | (4) | '- -differenceOnly--+-TRUE--+-' '-| -grant |-----' >--+--------------------------+--+--------------------------+---> '- -isolationLevel--+-CS-+-' | .-FALSE-. | +-RR-+ '- -showDetails--+-TRUE--+-' +-RS-+ '-UR-' >--+-----------------------+--+--------------------------+------> | (5) | | .-FALSE-. | '-| Trace options |-----' '- -validateXml--+-TRUE--+-' >--+--------+-------------------------------------------------->< '- -help-'
For a list and descriptions of these options, see BIND command.
After the StaticBinder utility generates the DBRM files, you must copy the files to a data set. The default DBRM data set name is prefix.DBRMLIB.DATA, where prefix is the high-level qualifier that is specified in the TSO profile for the user. prefix is usually your user ID in TSO.
If the DBRM data set does not already exist, you must create it. The DBRM data set requires space to hold all the SQL statements, with additional space for each host variable name and some header information. The header information requires approximately two records for each DBRM, 20 bytes for each SQL record, and 6 bytes for each host variable. For an exact format of the DBRM, see the DBRM mapping macro, DSNXDBRM in library prefix.SDSNMACS.
The following syntax diagram describes the options for generating DBRM files.
.-FALSE-. >>- -generateDBRM--+-TRUE--+-- -outputDBRMPath--path-----------><
The root name of the generated DBRM files is the root package name that you specify when you run the Configure utility.
The default is FALSE.
For example, suppose that you run the StaticBinder utility on a pureQueryXML file named capture.pdqxml. The utility creates the packages MYPKGA, MYPKGB, and MYPKGC. You then modify the statement set MYPKGA in capture.pdqxml and run the Configure utility on this file, with the -cleanConfigure option at its default value of FALSE. The Configure utility assigns a new consistency token to the statement set because the set has changed. When you run the StaticBinder utility on capture.pdqxml again to bind the new version of MYPKGA, you specify -differenceOnly TRUE. The utility rebinds only MYPKGA and does not rebind the other two packages.
.-,--------------------. V | >>- -grant-- "--grantees--(----+-authorization-ID-+-+--) - "--->< '-PUBLIC-----------'
For DB2 Database for Linux, UNIX, and Windows: You can use the USER, GROUP, and ROLE keywords. For information about these keywords, see GRANT (Package Privileges) statement.
For DB2 for z/OS: You can use the ROLE keyword. For information about this keyword, see GRANT (package privileges).
Restrictions:
The isolation level applies to all of the SQL statements that are in the package. If you set an isolation level through the Connection.setTransactionIsolation() method of the IBM® Data Server Driver for JDBC and SQLJ, pureQuery ignores that isolation level for statements executed statically.
The file must have the extension .pdqxml or .xml. The file must either be a resource in the classpath for the application or you must provide the full or relative path to the file.
>>-+------------------------+--+---------------------------+--->< '- -traceFile--file-name-' | .-OFF-----. | '- -traceLevel--+-ALL-----+-' +-SEVERE--+ +-WARNING-+ +-INFO----+ +-CONFIG--+ +-FINE----+ +-FINER---+ '-FINEST--'
For example, suppose that you ran the Configure utility on a pureQueryXML named myApp.pdqxml. When you ran the utility, you supplied values for the -collection, -pkgVersion, and -rootPkgName options, and the utility stored these values in the pureQueryXML file. You run the StaticBinder utility, specifying the name of this file, and the utility creates DB2 packages.
At a later time, you want to see a list of the packages that the StaticBinder utility created from the pureQueryXML file. When you run the utility, you can use the -verifyPackages option, specifying the value DETAIL, and again supply the name of the file.
If the values for the -collection, -pkgVersion, and -rootPkgName options are the same as when you ran the StaticBinder utility the previous time, the utility finds the packages and lists them.
However, if you ran the Configure utility on myApp.pdqxml after you first ran the StaticBinder utility and you changed any of the values for -collection, -pkgName, and -rootPkgName, the StaticBinder utility would not find any packages that matched the new values of these options. In its report, the StaticBinder utility would say that the packages that you were looking for do not exist.
The -verifyPackages option works on the premise that, after you ran the Configure utility on a pureQueryXML file and then ran the StaticBinder utility on that file, you did not run the Configure utility again on the file and supply different values for -collection, -pkgVersion, and -rootPkgName.
You can specify this option together with the -bindOptions option. However, the StaticBinder utility will not bind packages. Use -bindOptions only to specify the collection for the packages that you want to verify if you used this option to specify the collection when you created the packages.
Success or failure of XML schema validation is determined and reported for each input file. If one input file fails, the StaticBinder processing does not stop, subsequent files will be processed.
If a pureQueryXML file fails schema validation, the packages within that file will not be bound. The first schema validation error and the bind failure for the file are reported.
Only current release or previous version pureQueryXML files are validated (version 4 or 3). If an earlier version pureQueryXML is detected, validation is not performed on that file.