| Article: |
Stored Procedures for Java Programmers | |
| Subject: | Java Stored Procedures | |
| Date: | 2003-09-03 12:14:27 | |
| From: | anonymous2 | |
|
Nic, Why bother with a procedural language when you can store java in the database? Doesn't that give you everything you're talking about plus portability? Java Stored Procs has been supported by Oracle since 8i. Why use PL/SQL?? |
||
Showing messages 1 through 2 of 2.
-
Java Stored Procedures
2004-12-31 06:36:59 chumsnet.com [View]
-
Java Stored Procedures
2003-09-03 14:59:02 nferrier [View]
Primarily for the reason that I lay out in the article: PL/SQL expresses SQL much better than Java, I'd much rather write this:
open somecusor for select id from sometable;
than:
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select id from sometable");
Apart from anything it's 55 less keypresses.
To be honest I'm not sure why anyone uses Java inside the database.



Of course, PL/SQL is a beautiful stored procedure language for SQL lovers. Due to restrictions at a bank I worked for, I had to create ad hoc reports for bankers using 400-800 line single SQL statement. SQL is indeed a well proven expressive database query language. And for Oracle, and PostgreSQL, stored procedures are well optimzed for speed. So, for the time being, if speed is the most critical issue, I'll say that the old ways still rock.