If you want to correctly Add a stored procedure method to the OracleJavaProc class in actual operations, if you want to know how to develop it, the following are the correct steps: dropjava first, change the program, and then loadjava. So how to update it?
- D:eclipse3.1workspacedbtest>dropjava -u scott -v OracleJavaProc
- D:/tiger@iihero.oracledbeclipse3.1workspacedbtest>loadjava -u scott -v -resolve Or
- acleJavaProc/tiger@iihero.oracledb.java
- arguments: '-u' 'scott/tiger@iihero.oracledb' '-v' '-resolve' 'OracleJavaProc.java'
- creating : source OracleJavaProc
- loading : source OracleJavaProc
- resolving: source OracleJavaProc
The following application example:
- SQL> create or replace function query_hisal(grade number) return number as langu
- age java name 'OracleJavaProc.getHiSal(int) return int';
- /
The function has been created.
- SQL> set serveroutput on size 2000
- SQL> call dbms_java.set_output(2000);
The call is complete.
- SQL> select query_hisal(5) from dual;
- QUERY_HISAL(5)
- 9999
Usage personal opinion: Do not manually drop java source, do not manually drop procedure. The above content is an updated description of adding a stored procedure method to the OracleJavaProc class correctly. I hope it will help you in this regard.