The DB2Binder utility binds the DB2® packages that are used at the data server by the IBM® Data Server Driver for JDBC and SQLJ, and grants EXECUTE authority on the packages to PUBLIC. Optionally, the DB2Binder utility can rebind DB2 packages that are not part of the IBM Data Server Driver for JDBC and SQLJ.
>>-java--com.ibm.db2.jcc.DB2Binder------------------------------> >-- -url-- --jdbc--:--db2--:--//--server--+---------+--/--database--> '-:--port-' >-- -user-- --user-ID-- -password-- --password------------------> >--+--------------------+---------------------------------------> '- -size-- --integer-' >--+----------------------------------+-------------------------> '- -collection-- --collection-name-' >--+-----------------------------------+------------------------> | .-,------------. | | V | | '- -tracelevel-- ----trace-option-+-' .- -action--add-----. >--+-------------------+--+- -reopt--none---+-------------------> +- -action--replace-+ +- -reopt--always-+ +- -action--drop----+ +- -reopt--once---+ '- -action--rebind--' '- -reopt--auto---' .- -blocking--all-----. >--+- -blocking--unambig-+--+----------------------------+------> '- -blocking--no------' '- -optprofile--profile-name-' >--+---------------------------+--------------------------------> '- -owner--authorization-ID-' >--+---------------------------+--+-----------+-----------------> '- -sqlid--authorization-ID-' '- -generic-' >--+-------------------------+--+-----------------------+-------> '- -package--package-name-' '- -version--version-id-' >--+--------------------+--+-----------------------+------------> +- -keepdynamic--no--+ +- -release--commit-----+ '- -keepdynamic--yes-' '- -release--deallocate-' >--+-------------------------------------+--+-----------+-------> '- -bindOptions--"--options-string--"-' '- -verbose-' >--+--------+-------------------------------------------------->< '- -help-'
If -action rebind and -bindOptions are specified, -generic must also be specified.
-action drop applies only if the target data server is DB2 for z/OS®.
The meaning of the -size parameter depends on the -action parameter:
number-of-isolation-levels*
number-of-holdability-values*
integer+
number-of-packages-for-static-SQL
= 4*2*integer+1
The default -size value for -action
add or -action replace is 3.In most cases, the default of 3 is adequate. If your applications throw SQLExceptions with -805 SQLCODEs, check that the applications close all unused resources. If they do, increase the -size value.
If the value of -action is replace, and the value of -size results in fewer packages than already exist, no packages are dropped.
You can create multiple instances of the IBM Data Server Driver for JDBC and SQLJ packages on a single data server by running com.ibm.db2.jcc.DB2Binder multiple times, and specifying a different value for -collection each time. At run time, you select a copy of the IBM Data Server Driver for JDBC and SQLJ by setting the currentPackageSet property to a value that matches a -collection value.
-reopt applies to connections to DB2 for z/OS Version 8 or later, or DB2 for Linux, UNIX, and Windows Version 9.1 or later.
Cursors that are not declared with the FOR READ ONLY or FOR UPDATE clause which are not ambiguous and are read-only will be blocked. Ambiguous cursors will not be blocked
For the definition of a read-only cursor and an ambiguous cursor, refer to "DECLARE CURSOR".
-optprofile is valid only for connections to DB2 for Linux, UNIX, and Windows data servers.
-owner applies only to IBM Data Server Driver for JDBC and SQLJ packages.
-sqlid is valid only for connections to DB2 for z/OS data servers.
There is no default value for -keepdynamic. If you do not send a value to the data server, the setting at the data server determines whether dynamic statement caching is in effect. Dynamic statement caching occurs only if the EDM dynamic statement cache is enabled on the data server. The CACHEDYN subsystem parameter must be set to YES to enable the dynamic statement cache.
"parm1 value1 parm2 value2 … parmn valuen"
-bindOptions does not apply to IBM Data Server Driver for JDBC and SQLJ packages that are bound on DB2 for Linux, UNIX, and Windows data servers.
This option corresponds to the DEGREE(1) bind option.
This option corresponds to the DEGREE(ANY) bind option.
This option corresponds to the DYNAMICRULES(RUN) bind option.
This option corresponds to the DYNAMICRULES(BIND) bind option.
This option corresponds to the DYNAMICRULES(INVOKERUN) bind option.
This option corresponds to the DYNAMICRULES(INVOKEBIND) bind option.
This option corresponds to the DYNAMICRULES(DEFINERUN) bind option.
This option corresponds to the DYNAMICRULES(DEFINEBIND) bind option.
This option corresponds to the ISOLATION(UR) bind option.
This option corresponds to the ISOLATION(CS) bind option.
This option corresponds to the ISOLATION(RS) bind option.
This option corresponds to the ISOLATION(RR) bind option.
For connections to DB2 for z/OS data servers, you can also specify any bind package options that are listed on the following pages:
DB2 for z/OS version | List of supported bind options |
---|---|
V11 | Specification of DB2 for z/OS bind options from DB2 for Linux, UNIX, and Windows clients (DB2 Commands) |
V10 | Specification of DB2 for z/OS bind options from DB2 for Linux, UNIX, and Windows clients (DB2 Commands) |
If -action rebind and -bindOptions are specified, -generic must also be specified.
If the target data source for DB2Binder is not on the Windows operating system, DB2Binder returns one of the following return codes.
Return code | Meaning |
---|---|
0 | Successful execution. |
1 | An error occurred during DB2Binder execution. |
If the target data source for DB2Binder is on the Windows operating system, DB2Binder returns one of the following return codes.
Return code | Meaning |
---|---|
0 | Successful execution. |
-100 | No bind options were specified. |
-101 | -url value was not specified. |
-102 | -user value was not specified. |
-103 | -password value was not specified. |
-200 | No valid bind options were specified. |
-114 | The -package option was not specified, but the -generic option was specified. |
-201 | -url value is invalid. |
-204 | -action value is invalid. |
-205 | -blocking value is invalid. |
-206 | -collection value is invalid. |
-207 | -dbprotocol value is invalid. |
-208 | -keepdynamic value is invalid. |
-210 | -reopt value is invalid. |
-211 | -size value is invalid. |
-212 | -tracelevel value is invalid. |
-307 | -dbprotocol value is not supported by the target data server. |
-308 | -keepdynamic value is not supported by the target data server. |
-310 | -reopt value is not supported by the target data server. |
-313 | -optprofile value is not supported by the target data server. |
-401 | The Binder class was not found. |
-402 | Connection to the data server failed. |
-403 | DatabaseMetaData retrieval for the data server failed. |
-501 | No more packages are available in the cluster. |
-502 | An existing package is not valid. |
-503 | The bind process returned an error. |
-999 | An error occurred during processing of an undocumented bind option. |