Entering content frame

Background documentation EJB Locate the document in its SAP Library structure

This section contains the commands used for managing the J2EE Engine EJB Container Service. They are added to the shell environment by executing ADD EJB.

BEAN_INFO

Syntax

BEAN_INFO [-a applicationName] [-j jarName] [-b beanName] [-f fileName]

Arguments

 

[-a applicationName]

The name of a deployed application whose container displays information.

[-j jarName]

The name of a deployed JAR whose container displays information.

[-b beanName]

The name of a deployed bean whose container displays information.

[-f fileName]

The name of the file in which the information will be stored. If this parameter is specified, the information is stored locally in a file in the <SAPj2eeEngine_root_directory>/cluster/server directory and is not displayed in the command line. To change the file directory, specify the full path in the fileName parameter.

Description

Displays or stores locally in a file information about bean containers (such as the name of the application, JAR name, name of the bean, bean description, type of the bean, its pool class, and pool properties), as described in ejb-jar.xml. If more than one container satisfies the specified parameters, the command displays information for all of them.

 

CREATE_TABLES

Syntax

CREATE_TABLES <earName> [-dir dirName] [-classpath jar1;jar2;…] [-dbprops file.txt]

Arguments

 

<earName>

The full path to the EAR file whose database tables are to be created.

[-dir dirName]

The name of the directory that is created and in which a file containing the SQL statements necessary for the creation of the database tables is stored. The filename has the following format: create_earName.txt, where earName is the name of the EAR file. The SQL statements in the file are separated by semicolon (;).

Note

If this parameter is specified, the SQL create statements are stored in the corresponding text file, but the tables are not actually created in the database.

If this parameter is not specified, the system uses the data source, described in persistent.xml and creates the tables.

[-classpath jar1;jar2;…]

The paths to additional jar files used by the EAR. These JAR files are added to the class loader that is going to load them in the specified EAR.

[-dbprops file.txt]

The full path to a text file that contains the values of the arguments required to define the database types in the corresponding database. The contents of the file is of the following format:

VARCHAR_N = 200;

where

VARCHAR_N is the JDBC type;

200 is the value of that variable;

the variables are separated by semicolon (;) and are stored on separate lines.

Description

Creates tables in the database.

This shell command cannot be executed if the <db-vendor> element is not specified in persistent.xml.

 

DROP_TABLES

Syntax

DROP_TABLES <earName> [-dir dirName] [-classpath jar1;jar2;…]

Arguments

 

<earName>

The full path to the EAR file, whose database tables are to be deleted.

[-dir dirName]

The name of the directory that is created and in which a file containing the SQL statements necessary for the deletion of the database tables is stored. The name of the file is of the following format: drop_earName.txt, where earName is the name of the EAR file. The SQL statements in the file are separated by semicolon (;).

Note

If this parameter is specified, the SQL delete statements are stored in the corresponding text file, but the tables are not actually deleted from the database.

If this parameter is not specified, the system uses the data source, described in persistent.xml and deletes the tables.

[-classpath jar1;jar2;…]

The paths to additional jar files used by the EAR. These JAR files are added to the class loader that is going to load them in the specified EAR.

Description

Deletes tables from a database.

 

GENERATE_PERSISTENT

Syntax

GENERATE_PERSISTENT <earName> [-dbvendor vendorName] [-dsname dataSourceName] [-classpath jar1;jar2;…]

Arguments

 

<earName>

The full path to the EAR file.

[-dbvendor vendorName]

The name of the database, which will be used by the application.

The database types that can be used are: DB2_UDB, DB2_UDB_AS400, DB2_UDB_OS390, INFORMIX, MS_SQL_SERVER, ORACLE, SAPDB.

If the specified database name is wrong or this option is not used at all, the system will mark the database as unknown. That is, the value of the <database-vendor> element in persistent.xml will be set to unknown.

[-dsname dataSourceName]

The name of the data source that will be used by the bean.

Note

If you use this shell command to convert storage.xml into persistent.xml and you do not specify this property, the system will choose a random DBPool name from storage.xml and will set it as data source in persistent.xml.

 

[-classpath jar1;jar2;…]

The paths to additional JAR files used by the EAR. These JAR files are added to the class loader that is going to load them in the specified EAR.

Description

Generates persistent.xml for each JAR file that contains container-managed entity beans in the specified EAR.

If an old version of the persistent.xml file exists in the specified EAR, the old persistent.xml will not be replaced by the new one. In this case, the command will display a notification message. If you want to use the version generated by this shell command, you must first delete the old persistent.xml from your application EAR and then execute the shell command.

If old versions do not exist, the generated persistent.xml is added to the EAR in a directory called META-INF in the JAR file that contains container-managed entity beans.

If the specified EAR file is developed according to ejb1.1 and storage.xml exists in the “meta-inf” directory, then it is replaced by the corresponding persistent.xml.

This command generates default mapping and stores it in that persistent.xml. However, the generated persistent.xml does not contain the SQL statements for the EJB specific find methods. These statements must be added manually.

Example

GENERATE_PERSISTENT c:\work\myEAR.ear -dbvendor SAPDB -dsname myDBPool -classpath c:\work\myJAR.jar
This will generate persistent.xml and will store it in the META-INF directory in the myEAR.ear archive. The database that will be used is SAPDB; the name of the data source is myDBPool; a JAR file named myJAR.jar containing additional files required by the application is specified.

 

LIST_BEANS

Syntax

LIST_BEANS [-a applicationName] [-j jarName] [-f fileName]

Arguments

 

[-a applicationName]

The name of a deployed application whose beans are to be displayed.

[-j jarName]

The name of a deployed JAR whose beans are to be displayed.

[-f fileName]

The name of the file in which the information will be stored. If this parameter is specified, the information is stored locally in a file in the <SAPj2eeEngine_root_directory>/cluster/server directory and is not displayed on the command line. To change the file directory, specify the full path in the fileName parameter.

Description

Displays or stores locally in a file in a tree structure all enterprise beans in the specified application and/or JAR. If executed without parameters, this command displays all deployed applications and their beans.

 

 

Leaving content frame