Packages and application plans
A package contains control structures that DB2® uses when it runs SQL statements. An application plan relates an application process to a local instance of DB2 and specifies processing options.
Packages are produced during program preparation. You can think of the control structures as the bound or operational form of SQL statements. All control structures in a package are derived from the SQL statements that are embedded in a single source program.
An application plan contains one or both of the following elements:
- A list of package names
DB2 applications require an application plan. Packages make application programs more flexible and easier to maintain.
In general, you create plans and packages by using the DB2 commands BIND PLAN and BIND PACKAGE.
A trigger package is a special type of package that is created when you execute a CREATE TRIGGER statement. A trigger package executes only when the trigger with which it is associated is activated.
Packages for JDBC, SQLJ, and ODBC applications serve different purposes that you can read more about later in this information.