The EJB deployment tool provides a command-line interface that you can use to generate enterprise bean deployment code. The tool employs this command-line environment that enables you to run a build process overnight and have the deployment tool automatically invoked to generate your deployment code in batch mode.
Syntax
Example
ejbdeploy input_JAR_name working_directory output_JAR_name[-cp classpath] [-codegen] [-dbname name] [-dbschema name] [-dbvendor name] [-debug] [-keep] [-ignoreErrors] [-quiet] [-nowarn] [-noinform] [-rmic "options"] [-35] [-40][-trace] [-sqlj]Tip: By default, a DB2 database is created once you run the ejbdeploy command. If you want to create a different type of database, use the -dbname , -dbschema, and -dbvendor options to specify your choice.
Tip: You need to specify the location of the SQLJ translator JAR file, sqlj.zip. The default path for this file is DB2_install_dir\java, for example, d:\sqllib\java\sqlj.zip on Windows.
Note:
Note: This option is valid only on enterprise beans compliant with the 2.0 specification.
Enables you to use SQLJ instead of JDBC in the generated code to make calls to a DB2 database. If you use SQLJ, the EJB deployment tool generates an Ant script and a SQLJ serialized profile. You can run the Ant script against the profile to produce a DB2 package. These DB2 packages can be used at runtime to avoid extensive runtime checking. Once you have generated the deployment code for SQLJ using the EJB deployment tool, you will need to run the DB2 SQLJ customizer, db2sqljcustomize, against the generated .ser file, which is found in the subfolder of the websphere_deploy folder associated with the DB2 backend. Consult the DB2 documentation for more information on running the DB2 SQLJ customizer, or visit www7b.boulder.ibm.com/dmdd/zones/java/bigpicture.html (section SQLJ support).
Example: Running the ejbdeploy command:
Example
ejbdeploy AccessEmployee.ear d:\deploydir AccessEmployee_sqlj.ear -dbvendor DB2UDB_V81 -keep -sqlj -cp "e:\sqllib\java\sqlj.zip"
We have DB2 Universal database (version 8.1 for Windows and UNIX) installed in e:\sqllib.
The ejbdeploy command takes the AccessEmployee.ear file (which has enterprise beans that are compliant with the EJB 2.0 specification) as input and produces the AccessEmployee_sqlj.ear as output. Since the -sqlj option is used, SQLJ is used instead of JDBC in the generated code to make calls to DB2.
When ejbdeploy runs, it creates an Eclipse workspace in the directory that you specify as the working directory: d:\deploydir. When it has completed running, it deletes this workspace. The -keep option causes ejbdeploy to end without deleting the workspace.