The command allows users to utilize the pureQuery feature in Java™ Persistence API (JPA) applications.
Run the JPA commands (.bat on Windows or .sh on UNIX) from the <WAS_HOME>/bin directory.
The command syntax is as follows:
wsdb2gen.sh [parameters]
wsdb2gen [parameters]
wsdb2gen.bat [parameters]
Before running the command, your persistence.xml file must be in the META-INF directory and the META-INF directory must be in the class path.
The persistence.xml file must be included in the application Java archive (JAR) file and is also used as input in the DB2® bind to create the DB2 package. The 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.
Run the command from the <WAS_HOME> directory.
wsdb2gen.sh -pu payroll -collection prod1 -url jdbc:db2://myhostname:50000/proddb -user produser -pw secret
wsdb2gen -pu payroll -collection prod1 -url jdbc:db2://myhostname:50000/proddb -user produser -pw secret
wsdb2gen.bat -pu payroll -collection prod1 -url jdbc:db2:\\myhostname:50000\proddb -user produser -pw secret