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 -> Re: PLSQL versus OCI versus JDBC

Re: PLSQL versus OCI versus JDBC

From: Brian Peasland <oracle_dba_at_remove_spam.peasland.com>
Date: Wed, 18 Jun 2003 20:21:24 GMT
Message-ID: <3EF0C9C4.D5976C86@remove_spam.peasland.com>


I think you are right. That's what I get for paraphrasing off the top of my head. So I looked it up and he is talking about external stored procedures. I also like the 5th line:

If it can't be done in an external C routine, then you might need to think about why you need to do it....

And this is talking about programming for the database. This isn't talking about programming the UI, or doing something that isn't even related to the database (like image processing).

Cheers,
Brian

Dave Hau wrote:
>
> I like Tom's advice also. But my interpretation of Tom's words is that
> Tom is talking entirely about server side programming here, not client
> side. None of his items are referring to OCI or OCCI or JDBC. My
> interpretation is:
>
> 1. If it can be done in a single SQL statement, use one SQL statement.
> 2. If it can be done in a PL/SQL stored procedure, do it with a PL/SQL
> stored procedure.
> 3. If it can be done in a Java stored procedure, do it with a Java
> stored procedure.
> 4. If all else fails, then use a C external stored procedure.
>
> I don't think Tom mentioned C++ at all.
>
> Cheers,
> Dave
>
> Brian Peasland wrote:
> > I like the advice that Tom Kyte gives in his Expert One-on-one Oracle
> > book. Paraphrasing:
> >
> > 1. If it can be done in a single SQL statement, use one SQL statement.
> > 2. If it can be done in PL/SQL, do it in PL/SQL.
> > 3. If it can be done in Java, then do it in Java.
> > 4. If all else fails, do it in C++.
> >
> > I'd prefer to code as much in PL/SQL as possible. This should be faster
> > than coding it externally, at least for the database portion of the
> > application logic. The stored PL/SQL block will be compiled and ready to
> > go and not have to wait for data to be returned over the network.
> >
> > And PL/SQL is pretty easy to learn.
> >
> > HTH,
> > Brian
> >
> > Menelaos Perdikeas wrote:
> >
> >>Hi
> >>
> >>I 've got to built an application that would "synchronize" between two
> >>different database schemas (different structurally but semantically
> >>equivalent so that a mapping can be defined). Anyway, the logic for
> >>this mapping or synchronization (which will probably be run once a day
> >>and involve 1 millions rows) is quite involved and so I would rather
> >>built a client application in C++ using OCI or in Java using JDBCs to
> >>mediate between the two instances than rely on the loosely typed
> >>(according to my taste) PL-SQL. The code will be much more readable,
> >>maintainable and elegant (in my opionion) in a proper language than in
> >>PL-SQL. Anyway, thats not what I want to ask. My question is : would
> >>one expect the C++ or Java implementation to operate in a greatly
> >>reduced speed compared to PL-SQL ? Being an OO fan and nursing an
> >>inherent dislike for "languages" like PL-SQL, I would opt for C++ or
> >>Java even if it were 5 times slower. Do you feel this might be the
> >>case? ( I am only assuming that PL-SQL would be faster in this
> >>scenario since the data will not need to make the trip to a client PC
> >>and then back to the second server but the migration of data will take
> >>place entirely between the two servers). Any hints ?
> >>
> >>Thanks,
> >>Menelaos Perdikeas.
> >
> >

-- 
===================================================================

Brian Peasland
oracle_dba_at_remove_spam.peasland.com

Remove the "remove_spam." from the email address to email me.


"I can give it to you cheap, quick, and good. Now pick two out of
 the three"
Received on Wed Jun 18 2003 - 15:21:24 CDT

Original text of this message

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