Customizing and binding SQLJ profiles (DB2 Universal Database)

If you are using DB2 Universal Database, you can use the Customize and Bind SQLJ Profiles wizard to generate and run a SQLJ customization script in your SQLJ-enabled project. Running a customization script adds run-time information to the SQLJ serialized profiles in your project that is specific to DB2 Universal Database and binds the profiles to the database.

Prerequisites:

An SQLJ-enabled Java project uses a customization script to create packages on the database for the SQLJ profiles that are generated by the SQLJ translator. The customization script also binds the SQLJ profiles to the database, which enables your Java project to use static SQL rather than dynamic SQL. If you omit this activity, your project will use dynamic SQL, as JDBC does.

The Customize and Bind Profiles wizard generates the customization script from the information that you specify, and then runs the script. If you want to use the existing customization script that is associated with a Java project to bind the SQLJ profiles to another database, the wizard can bypass the customization process and only bind the profiles in the package to the database.

To customize and bind SQLJ profiles:

  1. In the Package Explorer view, right-click the Java project that contains the SQLJ profiles, and then click Customize/Bind SQLJ Profiles on the pop-up menu.

  2. Complete the wizard, and then click Run.

The customize process creates a customization script for the options selected and the values specified in the wizard, and then runs the script. The bind process creates four packages that reflect the four isolation levels that the DB2 database manager supports.

The progress and results of the customize and bind processes are shown in the Console view. By default, this view is not shown. To see the progress and results in the Console view:

You can set a preference to show the Console view automatically.

Command page
Use this page to select whether to customize the SQLJ serialized profiles in the project, in addition to binding the profiles to the database. You can also specify the run options for the process that you select.

Databases page
Use this page to specify database information for the bind process.

Packages page
Use this page to specify the properties for each package in the project.

Package Targets page
Use this page to select the packages that contain the profiles to bind to the database.

 

Parent topic

Developing SQLJ applications

 

Related concepts

Introduction to SQLJ

 

Related tasks

Adding SQLJ support to Java projects

Related reference
Restrictions on SQLJ (DB2 Universal Database)
sqlj - DB2 SQLJ Translator Command
db2sqljcustomize - DB2 SQLJ Profile Customizer Command
db2sqljbind - DB2 SQLJ Profile Binder Command