B.2. JPublisher

JPublisher is a utility that automatically generates custom Java classes that correspond to database object types. These classes then enable SQLJ programs to access those database objects. The JPublisher utility may be invoked from the command line using the following syntax:

jpub -user=user_name/password -sql=database_object_types [option_list]

The syntax elements are as follows:

user_name

The database username.

password

The database password.

database_object_types

Specifies a comma-separated list of database object types for which JPublisher will generate class files. If the -sql option is not specified, class files for all object types contained in the specified schema are generated.

option_list

A list of options separated by space characters. Table B-2 lists the various JPublisher options, along with their descriptions and default values.

Table B-2. jpub options
Option Description Default value
-builtintypes Specifies the set of type mappings to use for the non-numeric and non-LOB database columns when generating the custom Java classes. May be set to jdbc or oracle.

If set to jdbc (the default), then the database types CHAR, CHARACTER, LONG, STRING, VARCHAR, and VARCHAR2 are mapped to java.lang.String. RAW and LONG RAW are mapped to byte[]. DATE is mapped to java.sql.Timestamp.

If set to oracle, then CHAR, CHARACTER, LONG, STRING, VARCHAR, and VARCHAR2 are mapped to oracle.sql.CHAR. RAW and LONG RAW are mapped to oracle.sql.RAW. DATE is ...

Get Java Programming with Oracle SQLJ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.