Configuring your application to use SQLJ instead of JDBC

You can use SQLJ instead of JDBC to make calls to a DB2 database when deploying 2.x CMP beans. In order to do that, you have to configure your applications to use SQLJ.

Follow these steps:

  1. In the Project Explorer view, select the map under the Maps section of the EJB JAR, and double-click to open it.

  2. Select the root EJB module to database mapping in the Outline view, or select the EJB modules or database from the Overview section of the Mapping editor.

  3. In the Properties view, select SQLJ: Is using SQLJ in the Properties column.

  4. In the Value column, click the drop-down menu to select true.

  5. Save your changes.

The default values for the location of the SQLJ translator and main class should appear in the Properties view.

You can now specify a different location for the SQLJ translator and main class, if required, or proceed to run the ejbdeploy command .

 

Parent topic

Configuring EJB applications to use SQLJ instead of JDBC for enterprise bean persistence (workbench only)
Previous topic: Adding the SQLJ run-time JAR file to the class path
Next topic: Specifying a different location for the SQLJ translator and main class