Skip to Content
Oracle PL/SQL Programming: A Developer's Workbook
book

Oracle PL/SQL Programming: A Developer's Workbook

by Steven Feuerstein, Andrew Odewahn
May 2000
Intermediate to advanced
594 pages
11h 32m
English
O'Reilly Media, Inc.
Content preview from Oracle PL/SQL Programming: A Developer's Workbook

Expert

Q:

26-22.

The DDL statement to create the call spec will work fine; it won’t report any creation errors. When you attempt to execute the my_hello procedure, however, you receive an error message stating that there is no method named doIt in the class. The problem is that the method’s name is doit, not doIt (remember, case matters in Java!). To fix the problem, you must change the call spec to match the method name. Here’s the output from SQL*Plus:

SQL> SET SERVEROUTPUT ON
SQL> EXEC DBMS_JAVA.SET_OUTPUT(1000);

PL/SQL procedure successfully completed.

SQL> CREATE OR REPLACE PROCEDURE my_hello
  2  AS LANGUAGE JAVA
  3  NAME 'helloWorld.doIt()';
  4  /

Procedure created.

SQL> EXEC my_hello
java.lang.NoSuchMethodException: No applicable method found

..
BEGIN my_hello; END;

*
ERROR at line 1:
ORA-29531: no method doIt in class helloWorld
ORA-06512: at "SCOTT.MY_HELLO", line 0
ORA-06512: at line 1

Q:

26-23.

As in the previous exercise, the call spec compiles but doesn’t run. The problem in this case is that you can publish only static methods. To fix the problem, add the static keyword to the definition of doit, recompile, and reload the class.

Q:

26-24.

The following query displays information about the Java objects in a user schema:

SELECT object_name, object_type, status, timestamp FROM user_objects WHERE (object_name NOT LIKE 'SYS_%' AND object_name NOT LIKE 'CREATE$%' AND object_name NOT LIKE 'JAVA$%' AND object_name NOT LIKE 'LOADLOB%') AND object_type LIKE 'JAVA %' ORDER BY object_type, object_name; ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Oracle Database 12c PL/SQL Advanced Programming Techniques

Oracle Database 12c PL/SQL Advanced Programming Techniques

Michael McLaughlin, John Harper

Publisher Resources

ISBN: 9781449324070Errata Page