Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Java v. PL/SQL Stored Procedures

Java v. PL/SQL Stored Procedures

From: Craig Willis <cwillis_at_netignite.com>
Date: Wed, 04 Aug 1999 10:09:57 -0600
Message-ID: <37A865D5.5C956F28@netignite.com>


We are in the process of evaluating Oracle 8i Java stored procedures.

We performed some preliminary tests (simple class based on the emp.class that queries a table of 50,000+ rows). Basic timings indicate that the PL/SQL stored procedure is still almost twice as fast as the Java stored procedure.

I would like to transition to the Java stored procedures (it definitely beats PL/SQL in terms of open-standards), but we cannot justify it if the performance is half of that of PL/SQL.

Can anyone provide any insight? Documentation on Oracle benchmarks?

Thanks,
Craig

-------------emp.sql------------------

create or replace function sal_grade (current_sal in number) RETURN VARCHAR2
IS
BEGIN
  IF CURRENT_SAL > 0 AND CURRENT_SAL < 50000 THEN RETURN 'MTS'; END IF;   IF CURRENT_SAL >= 50000 AND CURRENT_SAL < 100000 THEN RETURN 'SMTS'; END IF;
  RETURN 'Salary out of range';
END sal_grade;
/

public class emp {
  public static String sal_grade (float current_sal) {

     if (current_sal > 0 && current_sal < 50000) return "MTS";
     if (current_sal >= 50000 && current_sal < 100000) return "SMTS";
     return "Salary out of range.";

}

  public static void approve_raise (float current_sal, float raise, float new_sal [ ]) {
     float percent_raise = (raise / current_sal) * 100;
     if (percent_raise > 15 || percent_raise < 5)
        new_sal[0] = -1;
     else {
        new_sal[0] = current_sal + raise;
     }

}

}
~ Received on Wed Aug 04 1999 - 11:09:57 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US