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??
Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • 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.
    • Java Stored Procedures
      2004-02-06 11:47:04  javid [View]

      There is a great reason to use Java Stored Procedures (java inside the database). Let's say that you have an application that only knows how to talk to datasources (such as Crystal Reports). Now let's say you want to integrate that application with another software application that only provides you with a Java API to extract data from. There is the perfect union. Call java stored procedures (or views on top of stored procedures) in Oracle, and then the Java code can load the data it needs out of the Java API.

      Java Stored Procedures are used a lot to integrate applications that only have access to datasources (oracle, db2, odbc, etc.).
    • Java Stored Procedures
      2003-10-27 11:56:37  anonymous2 [View]

      I would say the reason to consider using it is because you can write the same code for data access to run in or out of the db.