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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Java Stored Procedure - Beginner

Re: Java Stored Procedure - Beginner

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Tue, 2 Apr 2002 11:43:02 +0400
Message-ID: <a8bqrs$lcc$1@babylon.agtel.net>

  1. You get started by installing Oracle8i and reading Java Developer's Guide followed by Java Stored Procedures Developer's Guide, SQLJ Developer's Guide and JDBC Developer's Guide (quite a lot of reading you might say, but all books are often repeating the same things). Learn the basics, learn Oracle-specific features, look through examples, and off you go.
  2. It *is* Java, so it's OO. It's simply Java ran inside the database with persistent optimized local JDBC connection and a set of APIs for DML and things alike. There are issues with instantiation (you can't pass Java object as parameter to a PL/SQL proc, for example, so you need to create wrapper class which will hold an array of objects and will pass array indices in and out instead of objects), and a bit different security model, but it's still Java and you can do [almost] everything there they same way you do in plain Java apps.

I would mostly go with SQLJ since it hides the burden of JDBC programming within it's #sql {} macros. Oracle8i+ has SQLJ translator and runtime inside the database VM by default, so writing stored procedures with SQLJ is a snap (though I would go for as much PL/SQL as possible still - there are things that are done *much* easier in PL/SQL than in Java). Don't forget that Java is general purpose language, while PL/SQL is essentially Procedural SQL and is best suited for DML. In 9i they added almost all features it needed to be OO (they had encapsulation as of 8i, but no polymorphism nor inheritance which are welcome additions in 9i).

-- 
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.


"R Chin" <rchin_at_panix.com> wrote in message news:a8am3k$35a$1_at_news.panix.com...

> I'd like to learn Java Stored Procedure, suggestions please ?
>
> How do I get started ? What sw do I need ?
> Is it as OO as Java ?
>
> Thanks
>
> Robert
>
>
Received on Tue Apr 02 2002 - 01:43:02 CST

Original text of this message

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