Preliminary steps for running the DB2 SQLJ profile customizer using the Ant script

When you deploy enterprise beans, you can run the DB2 SQLJ profile customizer indirectly by using an Ant script that is generated as a result of running the ejbdeploy command against the EAR file.

However, before you run the Ant script, perform the following steps:

  1. Specify a working directory for the Ant script

  2. Update the Ant properties

 

Specifying a working directory for the Ant script

You must specify a working directory for the script. The script will create and delete files and subdirectories in this directory. If the working directory contains existing files and directories with the same name as the files and directories used by the script, they will be erased. For example:
ant -Dwork.dir=tmp -buildfile out.ear.xml

The script creates and uses a directory called tmp as its working directory.

To have the script use a different property file, set the script.property.file property when you run the script, for example:
ant -Dwork.dir=tmp -Dscript.property.file=other.properties -buildfile out.ear.xml

 

Updating the properties file

Change the values of the following items that are specified in the script as Ant properties by specifying new values in the property file:

  1. Database package names

    You must modify these names to ensure that the name for each customization profile does not conflict with an existing package name in the database. Ant scripts generated for different EAR files will use the same package names, and will overwrite each other's packages unless the names are changed, which will cause problems at run time.

  2. Database URL

    The Ant script defines a global property for the database URL (db.url). The DB2 SQLJ profile customizer uses a JDBC type 4 URL, for example:

    jdbc:db2://<host-name>:<port>/<database-name>

  3. Database user ID

    This global property, defined as db.user, is required.

  4. Password for the user ID

    This global property, defined as db.password, is required.

  5. Port

    The port will be 50000, unless you changed it when you installed DB2.

Tip: To find out the packages that are currently in a database, use DB2's Control Center. The packages are listed in the following directory: Instances/DB2/Databases/Database_name/Application Objects/Packages.

You can now run the Ant script.

 

Parent topic

Deploying EJB applications using SQLJ for data access
Previous topic: Running the EJB deployment tool
Next topic: Running the Ant script

 

Related concepts

DB2 SQLJ profile customizer