Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: Java Oracle howto docs
Melissa,
Unfortunately, the last time I tested this stuff was 8.1.6, so it may be hideously out of date. But for what it is worth...
In terms of stored procedures within the RDBMS, PL/SQL seems to perform better for most types of work than Java. Cursor manipulation, bind variables, bulk processing, etc. PL/SQL was simply built for working within the RDBMS engine. One possible reason for Java being slower may be the ³wrapper² of PL/SQL around Java stored procedures, which implies an extra layer of translation. Obviously, interfacing with the RDBMS through PL/SQL will be a drag if you don¹t do much inside the stored procedure (i.e. just in and out), so this shouldn¹t be a factor for large complex stored procedures.
However, Java, as a language, is superior to PL/SQL in at least one area, both inside and outside the RDBMS -- string manipulation. PL/SQL simply has inferior functions like SUBSTR and INSTR, each of which must syntactically start from the beginning of the string and ³seek² along the string by counting. Java allows direct subscripting, which is more efficient. Oracle could correct this situation by allowing the treatment of strings as arrays of characters (unlikely?). Perhaps SUBSTR and INSTR could be improved ‹ perhaps they already have. But if you build a stored procedure that performs a ton of SUBSTR and INSTR on large strings, be prepared to see your CPU consumption go through the roof.
In summary, for coding inside the RDBMS, PL/SQL was built for it, Java is accomodated. Intensive manipulation of large strings is a known exception.
On the app-server tier, naturally Java is the better fit, as the only software using PL/SQL outside the RDBMS engine are Oracle Forms and Oracle Reports. If you¹re using Forms and Reports then fine, use PL/SQL there too, otherwise use Java. Easy.
Again, the situation may have changed for 9iR2. Also, someone who knows Java and PL/SQL far better than I may come along and correct everything I¹ve said here, but at least we¹ll have given folks something to shoot at... :-)
Hope this helps...
-Tim
on 5/18/03 8:51 AM, Melissa Godlewski at mcgodlewski_at_yahoo.com wrote:
> Still hoping for someone's input! >
>> >> >> Do you Yahoo!? >> The New Yahoo! Search >> <http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com> - Faster. >> Easier. Bingo. > > Do you Yahoo!? > The New Yahoo! Search > <http://us.rd.yahoo.com/search/mailsig/*http://search.yahoo.com> - Faster. > Easier. Bingo.
-- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Tim Gorman INET: tim_at_sagelogix.com Fat City Network Services -- 858-538-5051 http://www.fatcity.com San Diego, California -- Mailing list and web hosting services --------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).Received on Sun May 18 2003 - 11:56:37 CDT