O'Reilly logo

Java Programming with Oracle SQLJ by Jason Price

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required