nerdexam
Oracle

1Z0-146 · Question #65

There is a Java class file in your system and you publish it using the following command: CREATE OR REPLACE PROCEDURE ccformat (x IN OUT VARCHAR2) AS LANGUAGE JAVA NAME…

The correct answer is D. Use the loadjava utility to load the Java class file into the database. To call a Java stored procedure, you must publish it through a call specification. Before you can call Java stored procedures, you must load them into Oracle Database instance and publish them to SQL. Loading and publishing are separate tasks. Many Java classes, which are…

Working with External Programs

Question

There is a Java class file in your system and you publish it using the following command:

CREATE OR REPLACE PROCEDURE ccformat (x IN OUT VARCHAR2) AS LANGUAGE JAVA NAME 'FormatCreditCardNo.formatCard(java.lang.String[])'; However, you receive the following error when executing the CCFORMAT procedure:

ERROR at line 1:

ORA-29540: class FormatCreditCardNo does not exist ORA-06512: at "SH.CCFORMAT", line 1 ORA-06512: at line 1 What would you do to execute the procedure successfully?

Options

  • AChange the listener configuration.
  • BCreate a directory object and link it to the Java class file.
  • CRebuild the Java class file when the database instance is running.
  • DUse the loadjava utility to load the Java class file into the database.

How the community answered

(32 responses)
  • A
    19% (6)
  • B
    3% (1)
  • C
    6% (2)
  • D
    72% (23)

Explanation

To call a Java stored procedure, you must publish it through a call specification. Before you can call Java stored procedures, you must load them into Oracle Database instance and publish them to SQL. Loading and publishing are separate tasks. Many Java classes, which are referenced only by other Java classes, are never published. To load Java stored procedures automatically, you can use the loadjava tool. It loads Java source, class, and resource files into a system-generated database table, and then uses the SQL CREATE JAVA {SOURCE | CLASS | RESOURCE} statement to load the Java files into Oracle Database instance. You can upload Java files from file systems, popular Java IDEs, intranets, or The following steps are involved in creating, loading, and calling Java stored procedures: Step 1: Create or Reuse the Java Classes Step 2: Load and Resolve the Java Classes Step 3: Publish the Java Classes Step 4: Call the Stored Procedures

Topics

#Java stored procedures#loadjava utility#Java class loading#external programs

Community Discussion

No community discussion yet for this question.

Full 1Z0-146 Practice