+

Search Tips   |   Advanced Search

Deploy SQLJ applications

Use Structured Query Language in Java (SQLJ) to develop data access applications that connect to DB2 databases. SQLJ is a set of programming extensions that enable you to use the Java programming language to embed statements that provide SQL (Structured Query Language) database requests.

The advantages of developing applications with SQLJ include improved performance and a shorter, more efficient development cycle. We can achieve the following with SQL:

Consider using SQLJ in situations where dynamic SQL is not needed, and where applications use DB2 as the database server.

The application server includes enhanced SQLJ support for applications that use container-managed persistence (CMP). The enhanced support includes the following items: include:

These enhancements reduce the complexity of installing, deploying, and customizing SQLJ applications for both container-managed and bean-managed persistence.

  1. Acquire the required drivers to deploy an SQLJ application in the application server. You need the following files, depending on the JDBC provider that you use:

    JDBC provider type Required files
    DB2 Using IBM JCC Driver

    This driver is also known as:

    • IBM Data Server Driver for JDBC and SQLJ

    • IBM DB2 Driver for JDBC and SQLJ

    • IBM DB2 Universal JDBC Driver.

    db2jcc.jar or db2jcc4.jar
    DB2 Universal JDBC driver (deprecated) db2jcc.jar

  2. Deploy the SQLJ application.

  3. Customize and bind the SQLJ profiles. Before the application server can use an SQLJ application, the SQLJ statements must be processed for the database server. By default, four DB2 packages are created in the database; one package is created for each isolation level. The customization process augments the profiles with information that is specific to the database. If we do not customize the SQLJ profiles, the SQLJ application uses dynamic SQL like a JDBC application.


Subtopics


Related tasks

  • Deploy SQLJ applications that use container-managed persistence (CMP) with the ejbdeploy tool
  • Customize and binding SQLJ profiles with the db2sqljcustomize tool
    Rational Application Developer: Developing SQLJ applications

  • Application management (AdminTask)