tags:

views:

41

answers:

2

hi,

my current java code is deployed to the DB and the plsql code calls it and uses it. I need to get the Java code out of the database and still be able to use it.

The options I had in mind are:

  1. Web services
  2. Java Stored Procedures
  3. Calling OS command using pl/sql
  4. RMI

What is your recommendation? please add cons and pros.

thanks, Leeran

A: 

my current java code is deployed to the DB and the plsql code calls it and uses it. I need to get the Java code out of the database and still be able to use it.

Can you clarify what "get the Java code out of the database" means to you? Is your intent to package it in a JAR and remove it from the database entirely? It's not clear to me whether or not you wish to move this operation to the middle tier and not have PL/SQL call it anymore.

Here are my thoughts on your proposed choices:

  1. Web services - moves the operation out of the database and onto the middle tier.
  2. Java Stored Procedures - I don't understand this. If it's in the database now, how does this change anything? You can certainly have any client call that PL/SQL, which in turn will invoke your Java code. It's a question of whether it's more efficient to perform that operation on the middle tier or on the database server.
  3. Calling OS command using pl/sql - I don't understand this at all.
  4. RMI - just another remoting choice, just like web services. If you encapsulate the operation as a Java POJO service you can remote the code any way you wish. This means only Java clients. A web service can accept a request from any client that can speak HTTP, including non-Java clients.
duffymo
thanks for your answer. i wrote a second comment, because i don't have enough space
now i have *.sqlj code in my system and I want to replace it with JPA Entities (using Hibernate). since it is not efficient to deploy JPA entities to the database, it has been decided that there will be no Java code deployed to the database, except for some functions that will call the outer java code.I spoke to the CTO and he suggested the options I wrote in my question. as for your questions:3. you can use plsql to call OS commands (like "javaw...")it is correct that java stored procedures is the current solution that we use, but I wanted your advise whether or not keep using it.
A: 

It isn't completely clear what you want to do or why. If you just want to re-use some code, as part of your build procedure, fetch the java from the database so it can be compiled and included in your jar/war file.

Tony Ennis