In order to make running the DB2® SQLJ profile customizer, db2sqljcustomize, easier, you can employ an Ant script. This particular Ant script is the one that is created when the batch SQLJ ejbdeploy command is run against an EAR file.
The Ant script is run against every customization profile in every EJB JAR in the associated EAR. The script will update each EJB JAR file with the modified customization profile, and will replace the JAR files in the EAR with the modified version. This Ant script is specific to the corresponding EAR file and it modifies the existing EAR file. This Ant script runs the DB2 SQLJ profile customizer against every customization profile in every EJB JAR in the associated EAR file
ant -buildfile out.ear.xml properties
This creates a properties file called out.ear.properties. This file contains properties specifying default names for the packages corresponding to each customization profile in the EAR file, for example:
pkg.One.jar.DB2UDBNT_V8_1=PKG2_ pkg.Two.jar.DB2UDBNT_V8_1=PKG1_
In this example, the EAR file contains two EJB JAR files, One.jar and Two.jar.
url.One.jar.DB2UDBNT_V8_1=jdbc:db2://localhost:50000/dbx user.One.jar.DB2UDBNT_V8_1=dbuser password.One.jar.DB2UDBNT_V8_1=dbpassword pkg.One.jar.DB2UDBNT_V8_1=TEST
url.Two.jar.DB2UDBNT_V8_1=jdbc:db2://localhost:50000/dby pkg.Two.jar.DB2UDBNT_V8_1=WORK
The script uses a set of default names for the packages created in the database.
The script will update each EJB JAR file with the modified customization profile, and will replace the JAR files in the EAR with the modified version. This Ant script is specific to the corresponding EAR file and it modifies the existing EAR file. For each customization profile, there are also properties to specify the URL, user and password. By default, the properties for the customization profile are set from the global properties.
This script for a particular EAR file reads properties from two files, ejbdeploy.sqlj.properties and (by default) ear_name.properties, where ear_name is the name of the EAR file. The ejbdeploy.sqlj.properties file is common to all Ant scripts generated by the ejbdeploy command, while ear_name.properties is specific to the Ant script for the EAR. You can have the Ant script use a file other than ear_name.properties by specifying the script.property.file property when you run the script.
For information about running Ant, refer to the Apache Ant manual at ant.apache.org/manual/index.html
The updated EAR file can now be installed into WebSphere Application Server.