Monday, April 7, 2008

JAVA- PLSQL STORED PROCEDURES

What is PL/SQL and what is it used for?

PL/SQL is Oracle's Procedural Language extension to SQL. PL/SQL's language syntax, structure and data types are similar to that of ADA. The PL/SQL language includes object oriented programming techniques such as encapsulation, function overloading, information hiding (all but inheritance).

PL/SQL is commonly used to write data-centric programs to manipulate data in an Oracle database.

Should one use PL/SQL or Java to code procedures and triggers?

Internally the Oracle database supports two procedural languages, namely PL/SQL and Java. This leads to questions like "Which of the two is the best?" and "Will Oracle ever desupport PL/SQL in favor of Java?”

Many Oracle applications are based on PL/SQL and it would be difficult of Oracle to ever desupport PL/SQL. In fact, all indications are that PL/SQL still has a bright future ahead of it. Many enhancements are still being made to PL/SQL.

For example, Oracle 9iDB supports native compilation of Pl/SQL code to binaries.PL/SQL and Java appeal to different people in different job roles.

The following table briefly describes the difference between these two language environments:

PL/SQL: Data centric and tightly integrated into the databaseProprietary to Oracle and difficult to port to other database systemsData manipulation is slightly faster in PL/SQL than in JavaEasier to use than Java (depending on your background)

Java:Open standard, not proprietary to OracleIncurs some data conversion overhead between the Database and Java type systemsJava is more difficult to use (depending on your background).

0 comments: