• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Native Java in Oracle vs PL/SQL (Why to use Java in Oracle?)

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Frnds,

First of alll I am a database guy. I just came to know that we can you java code natively with Oracle. But I didn't get the situation, how to decide when to use native java in oracle and when to use pl/sql.

May I get any source, any real problem, through which I come to know, for which things I need to move on Java and C, while having PL/SQL. What are the limitations of PL/SQL that can be done only in Java or C.

Actually I need some test cases. With my little experience I am not able to think when I should move for Java and C natively.

Thanks,
Manu
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think there are things doable with Java you could not do with PL/SQL. I guess PL/SQL would be more performant even (some of the latest optimizations - eg. the automatic bulk collect - are certainly unavailable in Java). The reasons for Java in Oracle DB (in my opinion) are:

1) you have an existing Java code you want to move to the database to save network roundtrips and cannot afford (or don't want to) port them to PL/SQL,

2) you have a third-party Java library you want to use in your database-side operations (we once had Java code in the database to generate PDF files using an Apache FOP library),

3) you need to develop database side code, but you or your developers know Java much better than PL/SQL.

If you already know PL/SQL and none of these points applies to you, I doubt you would benefit at all from switching to Java. PL/SQL offers you compile-time check against your schema (although there is SQLJ built in the database, but who uses it?), unbeatable ease of using bind variables (SQLJ again) and optimizations not readily available to Java.

In any case, this documentation seems to be a good starting point. (Earlier versions of this documentation seem to suggest that Oracle introduced Java into the database to substitute an application server it didn't have at that time. After Oracle introduced the OAS, some of the related functionality was removed from DB Java and migration to OAS was offered as a solution.)
 
Manu Batham
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Man.
 
Please enjoy this holographic presentation of our apocalyptic dilemma right after this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic