Oracle8i Java Developer's Guide
Release 3 (8.1.7)

Part Number A83728-01

Library

Service

Contents

Index

Go to previous page Go to beginning of chapter Go to next page

Shortened Class Names

Each Java source, class, and resource is stored in its own schema object in the server. The name of the schema object is derived from the fully qualified name, which includes relevant path or package information. Dots are replaced by slashes. These fully qualified names (with slashes)--used for loaded sources, loaded classes, loaded resources, generated classes, and generated resources--are referred to in this chapter as schema object full names.

Schema object names, however, have a maximum of only 31 characters, and all characters must be legal and convertible to characters in the database character set. If any full name is longer than 31 characters or contains illegal or non-convertible characters, the Oracle8i server converts the full name to a short name to employ as the name of the schema object, keeping track of both names and how to convert between them. If the full name is 31 characters or less and has no illegal or inconvertible characters, then the full name is used as the schema object name.

Because Java classes and methods can have names exceeding the maximum SQL identifier length, Oracle8i uses abbreviated names internally for SQL access. Oracle8i provides a method within the DBMS_JAVA package for retrieving the original Java class name for any truncated name.

FUNCTION longname (shortname VARCHAR2) RETURN VARCHAR2

This function returns the longname from a Java schema object. An example is to print the fully qualified name of classes that are invalid for some reason.

select dbms_java.longname (object_name) from user_objects 
   where object_type = 'JAVA CLASS' and status = 'INVALID';

In addition, you can specify a full name to the database by using the shortname() routine of the DBMS_JAVA package, which takes a full name as input and returns the corresponding short name. This is useful when verifying that your classes loaded by querying the USER_OBJECTS view.

FUNCTION shortname (longname VARCHAR2) RETURN VARCHAR2

Refer to the Oracle8i Java Stored Procedures Developer's Guide. for a detailed example of the use of this function and ways to determine which Java schema objects are present on the server.



Go to previous page
Go to beginning of chapter
Go to next page
Oracle
Copyright © 1996-2000, Oracle Corporation.

All Rights Reserved.

Library

Service

Contents

Index