Chapter 13. DBMS_JAVA

Table of Contents

13.1. Overview
13.2. Procedure
13.2.1. SET_OUTPUT
13.3. Functions
13.3.1. LONGNAME
13.3.2. SHORTNAME

This chapter briefly introduces the DBMS_JAVA package, and describes how to use the procedures and functions of the package.

13.1. Overview

DBMS_JAVA provides functions to access Java objects used in the database.

13.2. Procedure

13.2.1. SET_OUTPUT

Outputs a Java object on the screen, and uses a buffer as large as the specified input value.

Details about the SET_OUTPUT procedure are as follows:

  • Prototypes

    PROCEDURE
              SET_OUTPUT ( bufsize IN NUMBER DEFAULT 2000
              );
  • Parameters

    ParameterDescription
    bufsizeOutput buffer size.
  • Examples

    call DBMS_JAVA.SET_OUTPUT();
    call DBMS_JAVA.SET_OUTPUT(5000);

13.3. Functions

This section describes the functions provided by the DBMS_JAVA package, in alphabetical order.

13.3.1. LONGNAME

Returns the full name of a Java object.

Details about the LONGNAME function are as follows:

  • Prototypes

    FUNCTION
              LONGNAME ( shortname IN VARCHAR2 ) RETURN
              VARCHAR2;
  • Parameters

    ParameterDescription
    shortnameShort name of the Java object.
  • Examples

    SELECT dbms_java.longname(object_name) 
    FROM user_objects
    WHERE object_type='JAVA CLASS' AND status='VALID';

13.3.2. SHORTNAME

Returns the short name of a Java object when its full name is too long.

Details about the SHORTNAME function are as follows:

  • Prototypes

    FUNCTION
              SHORTNAME ( longname IN VARCHAR2 ) RETURN
              VARCHAR2;
  • Parameters

    ParameterDescription
    longnameFull name of the Java object
  • Examples

    DECLARE
      short_java_object_name VARCHAR2(128);
      long_laga_object_name VARCHAR2(128) ;
    BEGIN
      ...
      short_java_object_name := dbms_java.shortname(long_java_object_name);
    END;