Oracle FAQ Your Portal to the Oracle Knowledge Grid

Home -> Community -> Mailing Lists -> Oracle-L -> Re: Java Oracle howto docs

Re: Java Oracle howto docs

From: Tim Gorman <>
Date: Sun, 18 May 2003 08:56:37 -0800
Message-ID: <>


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...


on 5/18/03 8:51 AM, Melissa Godlewski at wrote:

> Still hoping for someone's input!

>>> I'm interested in finding some white papers or documents on the best way to
>>> use Oracle 9iR2 and Java. Is it better to run the loadjava and build call
>>> specs for the programs, or is it better to have the java run on the
>>> application server. Are PL/SQL stored procedures better to use then
>>> building Java Stored Procedures?
>>> I've read some of the Oracle documentation, but wanted opinions from people
>>> who have actually implemented Java and Oracle to see if following the Oracle
>>> recommendations is best.
>>> Any Help is Appreciated
>>> TIA
>>> M.Godlewski
>> Do you Yahoo!?
>> The New Yahoo! Search
>> <*>  - Faster.
>> Easier. Bingo.
> Do you Yahoo!?
> The New Yahoo! Search
> <*>  - Faster.
> Easier. Bingo.

Please see the official ORACLE-L FAQ:
Author: Tim Gorman

Fat City Network Services    -- 858-538-5051
San Diego, California        -- Mailing list and web hosting services
To REMOVE yourself from this mailing list, send an E-Mail message
to: (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

Original text of this message