Stored Procedures for Java Programmers
Subject:   Java Stored Procedures
Date:   2003-09-03 12:14:27
From:   anonymous2
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??
Main Topics Oldest First

Showing messages 1 through 2 of 2.

  • Java Stored Procedures
    2004-12-31 06:36:59 [View]

    While I was a small fish at Oracle, I strongly proposed using Java for everything, including using it as the language for stored procedures. Using just one universally understood, and powerful language for all things has one major advantage to the development team as a whole. Everyone just need to be proficient at one IDE, and one language. Business logic, and the development process will be the only thing need focussing. And in time, performance will be less an issue because of improved hardware. Think about using 1000GB RAIDED hard drives getting Terabyes of storage,1GB FSB speed RAM, and 128bit multi-processosrs in 5 years...

    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.
  • 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;


    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.