10.07.2015 Views

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

JDBC Developer's Guide - Supra - Cincom

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Generating Java classes from a database schemaThe ddltojava utility generates custom Java classes from a database schema.The utility processes the schema (.sch) file produced by the unloaddb utility,and generates Java classes for use in your applications.Even if you still have your schema file, <strong>Cincom</strong> recommends that you run theunloaddb utility to generate a new schema file. This ensures that all systemclasses are included in the schema used by the ddltojava utility.The name of the Java classes will be the database class name with a “j” prefix.For example, a database class named location will generate the Java classjlocation.java.The syntax of the ddltojava utility command is:ddltojava [ -d output_directory] [-p package_name][-preclass_prefix] [-v] schemafilewhere:-d output_directory Optional. This parameter is the name of an existingdirectory that will contain the resulting java files. Thedefault output location is the current workingdirectory.-p package_name This parameter influences the generated files. If youspecify a package name of sample.demodb, then thejava classes will be written tooutput_path\sample\demodb directory. Thesample\demodb directory will be created if it does notexist.-pre class_prefixOptional. This parameter is the prefix of thegenerated Java classes. For example, if you specify –pre java then, the names of the Java classes will be thenames in the schema preceded by the word java.-v Optional. This parameter is for the verbose mode. Itenables more messages.schemafileRequired. This parameter is the name of the schemadefinition file produced by the unloaddb utility.Generating Java classes with the CustomMappingDlg classThe CustomMappingDlg class contained in the %ORDB%\ordbjava.jar file is aJava swing application that you can use to generate java class files that map toyour <strong>Cincom</strong> ORDB classes. The tool can be invoked by the following command:java –cp %ORDB%\ordbjava.jar CustomMappingDlg<strong>JDBC</strong> <strong>Developer's</strong> <strong>Guide</strong>, P25-9504-03 Page 39Chapter: 4. <strong>Cincom</strong> ORDB ExtensionsSection: Creating custom Java classes for <strong>Cincom</strong> ORDB objects

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!