Documente Academic
Documente Profesional
Documente Cultură
0 Production
------------------------------------------------------
This file contains important information about version 9.2.0.1.0
Production of the Java Publisher utility, or JPub for short.
JPub generates Java source code that makes it easy for you to represent
Oracle Object types and PL/SQL packages in your SQLJ and Java programs.
JPub is documented in the _Oracle 9i JPublisher User's Guide_.
Additional information about JPub is found in the _Oracle 9i SQLJ
Developer's Guide and Reference_. Some of the comments in this README
file presume that you have seen the JPub documentation.
These notes are divided into four sections:
* Section 1 describes how to install and invoke JPub.
* Section 2 answers several frequently asked questions about JPub.
* Section 3 lists new features in this version.
* Section 4 lists bugs that have been fixed in this version.
* Section 5 lists known bugs and restrictions.
Question: I'm happy with the way JPub translates my object types to Java,
but I also want to use object types in C programs. How can I
accomplish this?
Another Oracle utility, the Object Type Translator (OTT), translates
object types to C.
The following changes were made to JPub between version 8.1.7.0.0 and
version 9.0.1.0.0.
- JPublisher now only generates SQLJ code for an Object type if
that type contains methods. Otherwise it will generate Java
code by default (unless you use the option setting
-methods=always).
- The JPub-generated code now provides abstraction from the
specifics of the JPublisher implementation. The following
protected methods are provided as a replacement for the
previously accessible _struct and _ctx fields:
getConnection() - to obtain the JDBC connection
getConnnectionContext() - to obtain the SQLJ context
create(Object,Datum,int) - for re-using the superclass-provided
implementation for a factory interface
setFrom(Object), setValueFrom(Object) - to transfer internal
state from another object
User-written classes for JPublisher 8.1.7 must be rewritten
to use these methods. Alternatively, you can use the backwards
compatibility setting -compatible=8i.
- By default JPublisher now uses SQLJ connection contexts of type
sqlj.runtime.ref.DefaultContext rather than creating and using
inner context classes _Ctx. This behavior can be adjusted
with the -context command line option.
- By default JPubllisher generates all wrapper classes into the
current directory. Previously, it would generate the wrapper
classes into a package hierarchy under the current directory.
To get this behavior you now need to explicitly specify the
setting "-dir=."
- JPublisher will translate SQL Object types that stand in an
inheritance relationship into a similar Java class hierarchy.
In addition, JPublisher will also generate initialization code
to create a type map that reflects this hierarchy.
Users just need to create an instance of the leaf types to ensure
that this initialization is performed.
- With the setting -usertypes=oracle, JPublisher now generates Java
classes that implement the interface oracle.sql.ORAData.
The new command line option -compatible=CustomDatum can be used
to generate classes for the backward compatible interface
oracle.sql.CustomDatum.
- The new JPublisher option -access permits control over the access
modifier of JPublisher-generated methods, and the new option
-context permits control over the class that is used for
SQLJ connection context (sqlj.runtime.ref.DefaultContext by
default), and also whether indiviual Java wrapper classes declare
their own individual SQLJ context types or not.
- JPublisher can now connected to the database with DBA authentication,
using the username SYS or INTERNAL.
The following changes were made to JPub between version 8.1.6.0.0 and
version 8.1.7.0.0.
- The following fields have been made protected in JPub-generated
code for SQL object types. This provides for additional capabilites
in user-written subclasses of the JPub-generated class.
- _ctx - the SQLJ connection context object
- _struct - the mutable struct object with the data in original SQL format
- The Java keyword "null" takes on special significance when used as the
Java name for mapping attributes or methods.
- no method will be generated when a SQL method is mapped to null
- no getter/setter methods will be generated when a SQL attribute is
mapped to null
SECTION 4: BUGS FIXED IN JPub Release 9.2.0
-------------------------------------------
2116164 JPublisher could throw a NullPointerException when
publishing top-level procedures and functions.
1757898 When you use JPublisher to generate Java code for a SQL
Object type hierarchy where some classes add method
definitions while others do not, JPublisher will now
generate all classes into .sqlj files (unless the option
-methods=false was specified). This ensures that the
generated files are compatible with one another.
n/a JPub now supports the following SQL argument types which
are also supported by JDBC 9.2 and/or SQLJ:
- OPAQUE types
- SQLJ object types
- TIMESTAMP types
- NCHAR
- NCLOB
- NVARCHAR2
n/a JPub can now support the PL/SQL argument types, either
automatically, or through a user-provided type conversion
between the PL/SQL type and a corresponding SQL type.
- BOOLEAN
- record types
- index-by tables
* If the user requests the same Java class name for two different object
types, the second class will silently overwrite the first. For example,
if the -input file contains
type PERSON1 as person
TYPE PERSON2 as person
the file person.java will be created for type PERSON1, and then
will be overwritten for type PERSON2.
* If the user requests the same attribute name for two different object
attributes, get and set methods will be generated for both attributes
without issuing a warning message. Whether or not the generated class
is legal in Java depends on whether the two get methods with the same
name and the two set methods with the same name have different argument
types so that they may be overloaded.