Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1. Java-Source: SOSSchedulerCommand.java

vor der Klassendefinition bitte einfügeninsert before the class definition

Code Block
  create or replace and compile java source named
    SOSSchedulerCommand
  as

und hinter der letzten Klammer ein Semikolon and after the last bracket a semicolon((wink)

>

...

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

2. Java-QuelleSource: DocumentFactorySchedulerCommandYourSchedulerCommand.java (if you have one)

insert before the class definitionvor der Klassendefinition bitte einfügen

Code Block
  create or replace and compile java source named
    DocumentFactorySchedulerCommand
  as

und hinter der letzten Klammer ein Semikolon ((wink)> Quell-Code mit SQL Worksheet in DB übergebenand 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

Code Block
   Create a PL/SQL-Prozedur mitwith folgendemthe Inhaltfollowing erzeugencontent:
Code Block
   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. Ausführungsberechtigungen für Add execution rights for TCP/UDP-Verbindungenconnections
a) Bei Verwendung von if using TCP:

Code Block
   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) Bei Verwendung von if using UDP (default):

Code Block
   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. Aufruftest mittels Testing with SQL Worksheet (or similar):

a) ProzedurProcedure

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

...

Code Block
   set serveroutput on size 5000
   call dbms_java.set_output(5000);

B. Zugriff via JDBC-Treiber muss getauscht werden

Sollen DB-Zugriffe erfolgen, dann muss der JDBC-Treiber mit einer Oracle-internen Connection verwendet werden

/** Oracle Version */

Code Block

 /**  Datenbankverbindung herstellen */
   public void db_connect() throws SQLException\{
      try \{
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         conn =  DriverManager.getConnection("jdbc:default:connection:");  errState = 1;
      \} catch(SQLException e) \{
         throw new SQLException ("DB connect failed" + e);
      \}
   \}

/** Java Version */
/** Datenbankverbindung herstellen */

Code Block

   public void db_connect() throws SQLException\{
      try \{
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         conn =  DriverManager.getConnection("jdbc:oracle:thin:@sag:1521:sag","sosdev","sosdev");
      \} catch(SQLException e) \{
         throw new SQLException ("DB connect failed" + e);
      \}
   \}