+

Search Tips   |   Advanced Search

Customize and binding profiles for Structured Query Language in Java (SQLJ) applications

Simplify the process of customizing and binding SQLJ profiles for the applications by performing these functions in the console or . SQLJ profiles must be customized and bound before the enterprise application can use the application's embedded SQL.

We must have an SQLJ application that has already been deployed and installed in the application server.

For SQLJ applications that use container-managed persistence, we can deploy the application in two ways:

For SQLJ application that use bean-managed persistence, see the topic on deploying SQLJ applications that use bean-managed persistence, servlets, or session beans.

To take advantage of SQLJ applications in the application server, we need to customizing the SQLJ profiles containing the embedded SQL statements. By default, four DB2 packages are created in the database; one for each isolation level. The customization process augments the profiles with information that is specific to the DB2 database. The database uses this information at run time.

In addition to profile customization, we need to bind the customized profiles to the DB2 database. Profile binding should only take place after the SQLJ profiles are customized.

We can also customize and bind profiles or the db2sqljcustomize tool:

  1. Make sure the necessary database tables exist, as described in the topic on deploying data access applications.

  2. Navigate to the SQLJ application installed in the application server. Click Applications > Websphere enterprise applications > app_name.

    Avoid trouble: Do not run multiple sessions of the console to customize and bind profiles that are in the same EAR file.gotcha

  3. Navigate to the SQLJ profiles section. Click SQLj profiles. When you click this link, the application server expands the EAR file for the application into a temporary directory; there might be a delay before the panel for SQLJ profiles is displayed.

  4. Select Customize and bind profiles or Bind packages. Choose the option based on the profiles with which we are working:

    • If the profiles have not been customized, or to customize the profiles again, choose Customize and bind profiles.

    • If the profiles are already customized, choose Bind packages.

  5. Choose to select profiles or a profile group to customize and bind.

    • Select profiles from the list provided.

      1. Select the profiles from the list and click Add. The list displays the SQLJ profiles that are present in the enterprise application.

        Best practice:

        • Select more than one profile by holding CTRL.

        • Select a contiguous list of profiles by selecting the first profile name, holding SHIFT, and selecting the last profile. You will select the first profile, last profile, and any profiles in the middle.

        bprac

      2. Select Customize/bind the selected SQLj profiles as a group This option specifies that the application server will create a .grp file containing the SQLj profiles that are processed. We can use the .grp file for other binding operations in the future. After we have completed this panel and click OK, you will be given an option to download the .grp file.

    • Select Use a profile group file to specify profiles to customize/bind. Select this to specify a profile group to process. Click Browse... to locate the file on the system.

  6. Complete the necessary information to connect to the database. You need to complete the following fields:

    Database URL

    Specifies the URL of the database to which the profile/s will be bound. The typical syntax is:

      jdbc:db2://<host name="">:port/<database name="">.</database></port></host> or

    or

      fully_qualified_host:port

    User

    User ID for the database administrator on the server where the database is located.

    Password

    Password for the database administrator on the server where the database is located.

    Additional options

    Specifies additional options to use during the customization and bind processes. See the DB2 documentation for a complete list of customization options.

    Class path

    Class path where sqlj.zip, and db2jcc.jar or db2jcc4.jar are located.

  7. Click OK.

    Avoid trouble: If we are processing a large enterprise application, or you are processing many SQLJ profiles, the process might take longer than the default timeout for the console. The default connection timeout for the application server's console is set to 30 minutes. If the default timeout is reached and you lose the connection to the server, we can check the system output log for the final results of the customization and bind process.

    To prevent this disconnection, configure the console session timeout to a longer period of time. After a successful customization and binding process, check the system output log for the total processing time. Use that time period as a basis for the new timeout value. For information about how to configure the console timeout, see the topic on changing the console session expiration. gotcha


Results

After the application server finishes processing the SQLJ profiles, you will see the results from the customization and binding. The results panel displays messages from the database server, as well as summary results from the application server.

If the operation completed successfully, the following message will be printed to the system log:

ADMA0507I=ADMA0507I: The SQLJ operation on application {0} completed successfully.  Exit code: {1}
ADMA0507I.explanation=This informational message indicates the program status.
ADMA0507I.useraction=No user action is required.
If the operation did not complete successfully, the following message will be printed to the system out log:
ADMA0506I=ADMA0506I: The SQLJ operation on application {0} did not complete successfully.  Exit code: {1}
ADMA0506I.explanation=The SQLJ operation encountered a problem.  This informational message indicates  the program status. Prior messages in the command output give details of the problem.
ADMA0506I.useraction=Check the command output for the cause of the problem.


Subtopics


Related tasks

  • Deploy SQLJ applications that use container-managed persistence (CMP)
  • Deploy SQLJ applications that use bean-managed persistence, servlets, or sessions beans
  • Deploy SQLJ applications that use container-managed persistence (CMP) with the ejbdeploy tool
    Rational Application Developer: Developing SQLJ applications
  • Deploy SQLJ applications

  • Application management (AdminTask)