Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!postnews.google.com!z34g2000cwc.googlegroups.com!not-for-mail
From: dbaplusplus@hotmail.com
Newsgroups: comp.databases.oracle.server
Subject: Re: Why use Java Stored Procedures....
Date: 3 Mar 2006 18:31:13 -0800
Organization: http://groups.google.com
Lines: 75
Message-ID: <1141439473.852375.324590@z34g2000cwc.googlegroups.com>
References: <1141206609.197352.140770@i39g2000cwa.googlegroups.com>
   <wjmNf.8000$Cp4.4804@edtnps90>
   <pan.2006.03.01.22.08.14.356624@telus.net>
   <1NqNf.17162$rL5.14763@newssvr27.news.prodigy.net>
   <heKdnWbQxrg-85vZRVn-uw@comcast.com>
NNTP-Posting-Host: 148.177.1.219
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1141439479 11997 127.0.0.1 (4 Mar 2006 02:31:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sat, 4 Mar 2006 02:31:19 +0000 (UTC)
In-Reply-To: <heKdnWbQxrg-85vZRVn-uw@comcast.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0),gzip(gfe),gzip(gfe)
Complaints-To: groups-abuse@google.com
Injection-Info: z34g2000cwc.googlegroups.com; posting-host=148.177.1.219;
   posting-account=Rsc_ew0AAADekMIc-dc4fPwmaOlJ6nox
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:262774


Jim Kennedy wrote:
> "Bob Jones" <email@me.not> wrote in message
> news:1NqNf.17162$rL5.14763@newssvr27.news.prodigy.net...
> >
> > "HansF" <News.Hans@telus.net> wrote in message
> > news:pan.2006.03.01.22.08.14.356624@telus.net...
> > > On Wed, 01 Mar 2006 19:09:16 +0000, Gerry Atric wrote:
> > >
> > >> Miggins wrote:
> > >>
> > >>> OK short question but probably not a quick answer....anyone give me
> the
> > >>> pros and cons of using Java for my stored proedures instead of PLSQL.
> > >>
> > >>
> > >>
> > >> CON: PL/SQL is 100% Oracle-centric while Java is not.  If you ever want
> > >> to
> > >> migrate your apps away from Oracle for some reason, keep in mind that
> all
> > >> of your PL/SQL code will have to be ported too.  My personal rule of
> > >> thumb,
> > >> anything I develop in PL/SQL I do with the assumption that it will
> never
> > >> be
> > >> ported in the future.
> > >
> > > If you copy Oracle-optimized Java stored procedures to other databases
> > > without thinking, the procedure is likely to have performance, locking
> > > or concurrency problems.
> > >
> > > If you did not take advantage of Oracle capabilities, you may be causing
> > > performance issues that can easily result in the need to purchase
> > > additional equipment and additional Oracle licenses.  Thus creating the
> > > perception that Oracle is expensive, even though the reason for the
> > > expense is laziness or simple misuse of the environment for the sake of
> > > 'independence'.
> > >
> > >
> > > Therefore, my belief is that using Java - if written properly (cost
> > > effectively) - must be ported in the same sense as PL/SQL ... with
> > > thought.
> > >
> >
> > Would you rather have a Java programmer migrating Java stored procedures
> to
> > a different database or have a PL/SQL programmer migrating PL/SQL stored
> > procedures to a foreign language for a different database?
> >
> >
>
> Java in the database isn't transparent.  You have to write pl/sql wrappers
> for all the exposed Java functions and stored procedures.  At some point
> writing a few simple if statements is just simpler to do in pl/sql. (than
> create wrapper and write in Java.)
>
> Java has some nice classes for certain types of things.  But using it in the
> database to just use it in the database instead of pl/sql is prone to
> problems and ineffeciencies.  Use the proper tool for the proper job. (don't
> assume everything is a nail if all you have is a hammer.)
> Jim

I wish Oracle would provide Java natively in database, so one does not
have to write PL/SQL as wrapper. I may be biased bit Java is much nicer
language than PL/SQL and not limited to database code. With Oracle
adding more and more Java (see number of .jar files supplied with
Oracle installation) in database and application server,
 may be some day Java is available just like PL/SQL.

Today, in reality, it is hard to find many applications where one will
write Java stored procedures. If one wants to do complex database
logic, one can do it outside Java stored procedures. However, if Java
was supported similar to PL/SQL many more people may use it.

