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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Using procedures instead of coding update/insert SQL...huh?

RE: Using procedures instead of coding update/insert SQL...huh?

From: Orr, Steve <sorr_at_rightnow.com>
Date: Mon, 14 Jan 2002 11:43:27 -0800
Message-ID: <F001.003EF5E8.20020114111018@fatcity.com>

DITTO THAT!!! You can also use PL/SQL for selects, not just inserts, updates and deletes. You do this by having the PL/SQL return a reference cursor and then the Java code takes it from there to display everything via jsp or whatever. I was DBA where we did this on a Java/Oracle development project. We had tons of queries and NO EMBEDDED SQL in the Java code. I could change (tune) the SQL queries in the PL/SQL packages without making any changes to the Java source code. We also used some native dynamic SQL for the queries with lot's of user interface driven permutations on the WHERE clause. This approach requires duhvelopers to work closely with DBAs/database dweebs and... depending on your demeanor, you can count this as a pro or a con. ;-)

Steve Orr

-----Original Message-----
Sent: Monday, January 14, 2002 9:01 AM
To: Multiple recipients of list ORACLE-L

Chris,

I personally think this is the best approach. Think of the application task:

1). Is it easier to perform Database Processing within PL/SQL than within Java? PL/SQL is a very strong development tool. Code development and maintenance-wise, I think it is much easier to do all the work in PL/SQL rather than in Java.
2). DB Tuning wise, this forces the application to always use bind variables - a very good thing.
3). Finally, it forces an application model to work in an n-tier model where Java is doing the presentation (making pretty pictures & interfacing with the db), and the database is doing what it does best - process the data within the db engine. Remember, of all the computers in the mix, the db server is usually the strongest machine of the bunch - why not take advantage of that power and make it do the db work.

Just my 2 cents.

Tom Mercadante
Oracle Certified Professional

-----Original Message-----
Sent: Monday, January 14, 2002 10:10 AM
To: Multiple recipients of list ORACLE-L

I just joined a new Oracle/Java project using Tomcat app server. On this project they decided to create an update procedure and insert procedure for every table. This procedure is then called in the Java code with the appropriate parameters passed, instead of simply coding the UPDATE or INSERT SQL directly in Java.

Does anyone else take this approach? I'm trying to understand the pros vs cons of this approach.

TIA!!! Chris
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Grabowy, Chris
  INET: cgrabowy_at_fcg.com
--

Please see the official ORACLE-L FAQ: http://www.orafaq.com
--

Author: Orr, Steve
  INET: sorr_at_rightnow.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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 Mon Jan 14 2002 - 13:43:27 CST

Original text of this message

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