Adding the SQLJ run-time JAR file to the class path
In preparation for running your application using SQLJ in your product's test environment and in WebSphere Application Server, add the SQLJ run-time JAR to the class path of the JDBC provider of the data source that is used by the EJB project. This does not replace any other DB2 JAR files on this class path.
The SQLJ run-time JAR file contains the SQLJ translator code. It must be on the classpath before you can run the SQLJ translator.
To add the SQLJ run-time JAR file to the class path:
- In the Project Navigator view, right-click the EJB project and select Properties.
- In the Properties page, click Java Build Path.
- On the Source page, you can specify if you want to create an output folder for the deployment code to be generated into, corresponding to each source folder: select or clear the Allow output folders for source folders check box.
Restriction: Due to a J2EE restriction, if you do specify an output folder for each source folder, however, you will not be able to run the EJB project in the WebSphere test environment.- Click the Libraries tab.
- Click the Add External JARs button. TheJAR selection dialog box opens.
- Browse to the file specified, depending on the DB2 version, and click OK.
DB2 V8.x: DB2_install/java/db2jcc.jar, where DB2_install is your DB2 installation directory.
You will also need to ensure that the data source is configured to use com.ibm.websphere.rsadapter.DB2UniversalDataStoreHelper as the data source helper class.
For DB2 Version 8, fix pack 2 and above, you also require the license file.
Parent topic
Configuring EJB applications to use SQLJ instead of JDBC for enterprise bean persistence (workbench only)
Next topic: Configuring your application to use SQLJ instead of JDBC