Syntax of entries in the Default.bindProps file for configuring support of static SQL in pureQuery code

Use the Default.bindProps file to specify options for determining how SQL statements are bound into DB2® packages.

In this file, you can specify options that apply to all of the interfaces that are in your project. You can also specify options specific to individual interfaces.

You can add comments to this file. Begin each comment with a # symbol.

As you create or edit entries, you can type CTRL+SPACE (or your own keystroke, if you changed this default one) for assistance.

For help understanding syntax diagrams, see How to read syntax diagrams.

The following diagram shows the syntax that is allowed for setting default options in this file.

Read syntax diagramSkip visual syntax diagram
>>-defaultOptions--=--+- -bindOptions-- -"--bind-options--"-+--->
                      |                  (1)                |   
                      '-| DBRM options |--------------------'   

>--+----------------+--+--------------------------+------------->
   |            (2) |  '- -isolationLevel--+-CS-+-'   
   '-| -grant |-----'                      +-RR-+     
                                           +-RS-+     
                                           '-UR-'     

>--+-----------------------+-----------------------------------><
   |                   (3) |   
   '-| Trace options |-----'   

Notes:
  1. For the syntax, see the description of these options.
  2. For the syntax, see the description of this option.
  3. For the syntax, see the description of these options.

The next syntax diagram shows the syntax that is allowed for setting options for individual interfaces that the file lists.

Read syntax diagramSkip visual syntax diagram
>>-Java-package.interface--=------------------------------------>

>--+- -bindOptions-- -"--bind-options--"-+---------------------->
   |                  (1)                |   
   '-| DBRM options |--------------------'   

>--+----------------+--+--------------------------+------------><
   |            (2) |  '- -isolationLevel--+-CS-+-'   
   '-| -grant |-----'                      +-RR-+     
                                           +-RS-+     
                                           '-UR-'     

Notes:
  1. For the syntax, see the description of these options.
  2. For the syntax, see the description of this option.
defaultOptions
Specifies that the options on the line apply to the SQL statements in all of the interfaces that are listed in this file. Only one line in the file is allowed to start with this keyword.
Java-package.interface (at the beginning of a line in an options file)
Specifies that the options on the line apply only to the SQL statements in the specified interface. These options override options that you specify as defaults.
You must qualify the name of the interface with the name of the Java™ package to which the interface belongs.
-bindOptions "string-of-bind-options"
These options have the same function as the DB2 precompile and bind options with the same names. If you are preparing your program to run on a DB2 for z/OS® system, specify DB2 for z/OS options. If you are preparing your program to run on a DB2 for Linux®, UNIX®, and Windows® system, specify DB2 for Linux, UNIX, and Windows options.

The syntax of the string is "option_1 value_1 option_2 value_2".

For a list and descriptions of these options, see BIND command.
The REOPT bind option can be useful in pureQuery code. With this option, you can use parameter markers in SQL statements, and still optimize DB2 access paths. See the following links for information about using this option with supported DB2 databases:
DBRM options
Use these options to generate DBRM files, rather than create packages. These options apply only if you are using DB2 for z/OS.

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.

Read syntax diagramSkip visual syntax diagram
>>- -generateDBRM--+-TRUE--+-- -outputDBRMPath--path-----------><
                   '-FALSE-'                           

-generateDBRM
Specifies whether to generate DBRM files, instead of create packages. If generateDBRM is TRUE, then by default the StaticBinder utility generates four DBRM files, one for each isolation level: CS, RR, RS, UR. However, you can generate only one DBRM file if you specify the -isolationLevel option.

The root name of the generated DBRM files is the root package name that you specify when you run the Generator utility. If this name is longer than seven characters, the StaticBinder utility throws an exception.

-outputDBRMPath path
Specifies the directory in which to save the generated DBRM file. The default value is the directory from which you run the StaticBinder utility.
-grant "grantees(firstID,secondID,...)"
Specifies the list (in parentheses) of comma-separated grantees to whom you want to grant the EXECUTE privilege on packages that the StaticBinder utility creates. If you do not specify this option, the StaticBinder utility does not grant this privilege.
Read syntax diagramSkip visual syntax diagram
                             .-,--------------------.          
                             V                      |          
>>- -grant-- "--grantees--(----+-authorization-ID-+-+--) - "---><
                               '-PUBLIC-----------'            

grantees
The comma-separated list of authorization IDs to which you want to grant the EXECUTE privilege. Ensure that the authorization IDs that you list are valid for the DB2 database that you are using.

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:

  • You cannot use the -grant option when the value of the -generateDBRM option is TRUE.
  • In an options file, you can use the -grant option either in the defaultOptions line or for one or more individual entries in the file. You cannot use -grant in both locations in a single options file.
-isolationLevel CS|RR|RS|UR
Specifies that you want to generate a single DB2 package or DBRM file that is for a particular isolation level, rather than one DB2 package or DBRM file for each of the four isolation levels.

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.

UR
Specifies Uncommitted Read as the isolation level.
The StaticBinder utility adds 1 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Generator utility.
The StaticBinder utility adds 1 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Configure utility.
CS
Specifies Cursor Stability as the isolation level.
The StaticBinder utility adds 2 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Generator utility.
The StaticBinder utility adds 2 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Configure utility.
RS
Specifies Read Stability as the isolation level. Read Stability ensures that the execution of SQL statements in the package is isolated from other application processes for rows that are read and changed by the application.
The StaticBinder utility adds 3 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Generator utility.
The StaticBinder utility adds 3 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Configure utility.
RR
Specifies Repeatable Read as the isolation level.
The StaticBinder utility adds 4 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Generator utility.
The StaticBinder utility adds 4 to the name of the created package or DBRM file, unless you used the -forceSingleIsolationLevel option when you ran the Configure utility.

Feedback