Cleaning Up

What we have just seen is merely an example of how Java stored procedures operate. You wouldn't normally invoke a Java stored procedure just to get the time from a SELECT statement. It would be much simpler to just invoke the built-in SYSDATE function. For example:

SELECT SYSDATE FROM DUAL;

The real usefulness of Java stored procedures is to do something hard or impossible to do in PL/SQL.

So let's remove this example from the database with these commands:

DROP FUNCTION f_get_oracle_time; DROP JAVA SOURCE myapp4;

Get Expert Oracle and Java Security: Programming Secure Oracle Database Applications with Java now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.