(1) >>-java--com.ibm.pdq.tools.StaticBinder-------------------------> (2) >-------- -url--jdbc--:--db2--:--//--server--+---------+--/--database--> '-:--port-' >-- -username--user-ID-- -password--password--------------------> >-- -archive-- -filename--+-.ear-+------------------------------> +-.jar-+ +-.war-+ '-.zip-' >--+------------------------------------------------------------------------+--> | (3) | +-| DBRM options |-------------------------------------------------------+ +- -bindOptions-- -"--bind-options--"--+-------------------------------+-+ | '- -verifyPackages--+-DETAIL--+-' | | '-SUMMARY-' | '- -verifyPackages--+-DETAIL--+------------------------------------------' '-SUMMARY-' >--+-----------------------------+--+----------------+----------> | .-FALSE-. | | (4) | '- -differenceOnly--+-TRUE--+-' '-| -grant |-----' >--+--------------------------+--+-----------------------+------> '- -isolationLevel--+-CS-+-' | (5) | +-RR-+ '-| Trace options |-----' +-RS-+ '-UR-' >--+--------------------------+-------------------------------->< | .-FALSE-. | '- -showDetails--+-TRUE--+-'
The archive can contain an options file with the extension .bindProps that lists the pureQueryXML files that you are supplying to the StaticBinder utility. If you do not specify a .bindProps file as part of the command, the StaticBinder utility searches the archive for a .bindProps file. The StaticBinder utility uses the first .bindProps file found in the archive. The utility starts the search at a top level EAR, JAR, or WAR.
If you specify the name of the .bindProps file with the StaticBinder command, the specified file is used.
When binding DAO implementations with the -archive option, the StaticBinder utility loads implementation classes to obtain information from them. The loading of classes might require the loading of dependent classes from the EAR, JAR, or WAR files.
During the bind operation with -archive option, the StaticBinder utility might return errors about classes not being found. For example, some enterprise applications that require the context of an application server might return such errors.
To minimize the StaticBinder utility loading dependencies, you can place the Apache BCEL library on the classpath. When the BCEL library available is available to the StaticBinder utility, the utility uses bytecode modification to exclude implementation dependencies and minimize the number of classes loaded. In most cases, adding the library to the classpath resolves errors due to not finding classes.
The Apache BCEL JAR file is not shipped with pureQuery Runtime. The BCEL library is available from the Apache project website.
The value for each option cannot contain spaces.
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. Then you edit the statement set MYPKGA in capture.pdqxml with the workbench and run the Configure utility on the 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).
Restriction: You cannot use the -grant option when the value of the -generateDBRM option is TRUE.
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.
>>-+------------------------+--+---------------------------+--->< '- -traceFile--file-name-' | .-OFF-----. | '- -traceLevel--+-ALL-----+-' +-SEVERE--+ +-WARNING-+ +-INFO----+ +-CONFIG--+ +-FINE----+ +-FINER---+ '-FINEST--'
-url jdbc:db2://localhost:50000/SAMPLE:enableNamedParameterMarkers=1;
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.
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.
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.
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.
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.