You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Activate Java Code in Oracle

1. Java-Source: SOSSchedulerCommand.java

insert before the class definition

  create or replace and compile java source named
    SOSSchedulerCommand
  as

and after the last bracket a semicolon((wink)

> put the source code to db using SQL Worksheet or similar.

2. Java-Source: YourSchedulerCommand.java (if you have one)

insert before the class definition

  create or replace and compile java source named
    DocumentFactorySchedulerCommand
  as

and after the last bracket a semicolon((wink)> put the source code to db using SQL Worksheet or similar.

3. Wrapper Procedure: Scheduler_Add_Order.sql

   Create a PL/SQL-Prozedur with the following content:
   create or replace procedure SCHEDULER_ADD_ORDER(host varchar2, port number, letter number, status number, model number, job_chain varchar2)
   as language java
   name 'DocumentFactorySchedulerCommand.addOrder(java.lang.String, int, int, int, int, java.lang.String)';

4. Add execution rights for TCP/UDP-connections
a) if using TCP:

   call dbms_java.grant_permission( 'FACTORY', 'SYS:java.net.SocketPermission', 'localhost', 'resolve' );
   call dbms_java.grant_permission( 'FACTORY', 'SYS:java.net.SocketPermission', '127.0.0.1:4363', 'connect,resolve' );

b) if using UDP (default):

   call dbms_java.grant_permission( 'FACTORY', 'SYS:java.net.SocketPermission', 'localhost:1024-', 'listen,resolve' );
   call dbms_java.grant_permission( 'FACTORY', 'SYS:java.net.SocketPermission', '127.0.0.1:4363', 'accept,resolve' );

A. Testing with SQL Worksheet (or similar):

a) Procedure

   /* host, port, letter, status, model, job_queue */
   CALL SCHEDULER_ADD_ORDER( 'localhost', 4363, 4711, 0, 2, 'factory_print' );

b) Debugging

   set serveroutput on size 5000
   call dbms_java.set_output(5000);
  • No labels