wsdb2gen command


 

+

Search Tips   |   Advanced Search

 

The command allows users to utilize the pureQuery feature in Java Persistence API (JPA) applications.

wsdb2gen.sh [parameters]

Before running the command, the persistence.xml file must be in the META-INF directory and the META-INF directory must be in the class path.

 

Parameters

-help Display the help information.
-pu Name of the persistence unit defined in persistence.xml file.
-collection jollection-id is assigned to package names. The default is NULLID.
-url URL of the target database. Used to validate the generated SQL. A url must be specified either in the persistence.xml file or as a command option. If both are specified, the url specified in the command option will be used.
-user The user id
-pw Corresponding password to connect to target database. If not specified, value in persistence.xml will be used.
-package Takes the string value package name and a single DB2 package with the specified name is generated.

If not specified, then one package is generated for each entity class. The name consists of seven or fewer letters. For each entity class, the first seven characters of the entity class is used for the package name. If the first seven characters are not unique, then the package name is changed to create a unique name.

 

Usage

The persistence.xml file must be included in the application JAR file and is also used as input in the DB2 bind to create the DB2 package.

The wsdb2gen command requires a connection to a database in order to validate generated SQL. The database does not have to be the same as the run time database, but it should be at the same version and release level. Ensure the following JAR files are on the class path:

If the database URL specifies a DB2 for zOS database, then the following JAR file must also be on the class path: db2jcc_licence_cisuz.jar

 

Examples

wsdb2gen.sh -pu payroll -collection prod1 -url jdbc:db2: //myhostname:50000/proddb -user produser -pw secret





 

Related tasks

Develop and packaging JPA applications for a Java EE environment
Develop and packaging JPA applications for a Java SE environment
Set to use pureQuery in a Java EE environment
Set to use pureQuery in Java SE environment