Rem
Rem $Header: javavm/ojvmwcu/install/load_ojvmwcu.sql /st_javavm_19.0.0.0.0ojvmru/1 2025/02/09 06:26:32 mayamasi Exp $
Rem
Rem load_ojvmwcu.sql
Rem
Rem Copyright (c) 2015, 2025, Oracle and/or its affiliates. 
Rem All rights reserved.
Rem
Rem    NAME
Rem      load_ojvmwcu.sql - <one-line expansion of the name>
Rem
Rem    DESCRIPTION
Rem      <short description of component this file declares/defines>
Rem
Rem    NOTES
Rem      <other useful comments, qualifications, etc.>
Rem
Rem    BEGIN SQL_FILE_METADATA 
Rem    SQL_SOURCE_FILE: javavm/ojvmwcu/load_ojvmwcu.sql 
Rem    SQL_SHIPPED_FILE: 
Rem    SQL_PHASE: 
Rem    SQL_STARTUP_MODE: NORMAL 
Rem    SQL_IGNORABLE_ERRORS: NONE 
Rem    SQL_CALLING_FILE: 
Rem    END SQL_FILE_METADATA
Rem
Rem    MODIFIED   (MM/DD/YY)
Rem    kdere       09/16/18 - Removing third party jars
Rem    kdere       11/28/17 - Renaming ojvmwcu-utls.jar to ojvmwcu-utls.jar
Rem    kdere       04/21/17 - Removing hk2 utils jar
Rem    kdere       03/28/17 - Removing creation of install schema
Rem    kdere       11/19/15 - Remove Version number
Rem    kdere       11/02/15 - Removing annotation jar
Rem    kdere       08/13/15 - Created
Rem

create or replace package ojvmwcu_install authid current_user as
 procedure require_sys;
 procedure load_ojvmwcu;
end ojvmwcu_install;
/ 

create or replace package body ojvmwcu_install as

procedure require_sys as
begin
  if login_user != 'SYS' then
    declare
      foo exception;
      pragma exception_init(foo,-1031);
    begin
      raise foo;
    end;
  end if;
end;

procedure load_ojvmwcu as
  verifier_status number;
  trash varchar2(300) := dbms_java.endsession_and_related_state;
begin
  require_sys;
  verifier_status := dbms_java.option_controller(2,3);
  begin
    ojvmwcu_sys.load_jar( 'ojvmwcu-utls.jar' );   
    ojvmwcu_sys.load_jar( 'oracle-jaxrs-ri.jar' );  
    if verifier_status = 1 then
       verifier_status := dbms_java.option_controller(2,2);
    end if;
  exception when others then
    if verifier_status = 1 then
       verifier_status := dbms_java.option_controller(2,2);
    end if;
    raise;
  end;
end;

end ojvmwcu_install;
/
