GeeCON Prague 2014*
The moose likes Beginning Java and the fly likes How to load a Java application to Oracle DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How to load a Java application to Oracle DB" Watch "How to load a Java application to Oracle DB" New topic
Author

How to load a Java application to Oracle DB

Rudy Sam
Greenhorn

Joined: May 25, 2005
Posts: 4
Hello,
I am a beginner and I must say you guys are doing a great job here in javaranch.
I have a question regarding how to upload a java application which transfers data from oracle to another system in Oracle DB.

How could I accomplish this task? I mean how to upload a java application into oracle DB.

How can I call the java application from sqlplus after uploading it in Oracle DB? Are there any examples some where to demonstrate this?

Thank you all for helping out.
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

Not sure what you mean by 'upload a java application to oracle'. Applications use databases, but databases don't often invoke applications directly. Sqlplus allows you to run command line utilities, so you could (although I haven't tried) invoke a java application in a sqlplus script.


My Blog: Down Home Country Coding with Scott Selikoff
Rudy Sam
Greenhorn

Joined: May 25, 2005
Posts: 4
Hi Scott,

What I mean is this: I have a java application I have developed. This application runs independently. I want to send this application to the Oracle DB so that the application should be triggered any time an update is done on a particular table in the DB. Now, to my understanding, any java application that is sent to the DB is called a java stored procedure. Is this right?

My problem now is that; how can I send (upload) this application to the Oracle DB? Is there any utility out there that I can use to accomplish my task?

Also after uploading the java application in the DB, how can I invoke it? I mean calling it to carry it function--> Which is to transfer data to another system. Is there any tutorial or an example which shows how to invoke or call a java stored procedure in the DB? I hope I am more clear now. Thanks!
Scott Selikoff
author
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3710
    
    5

There's no such thing as a java stored procedure, but there are such things as database stored procedures. They are written in a derivation of SQL called PLSQL/TSQL and supposed to be somewhat standard accross all database, although in general they have to be customized per database.

You can use SQL statements to upload/delete the procedure using "CREATE PROC"/"DROP PROC" as well as executing it often just using its name or with "USE" command as you would a SQL statement. But even these can vary from database to database in precise synatax.

It also depends what you want to do, since stored procedures are somewhat limited in functionality and ease of use.
[ November 21, 2005: Message edited by: Scott Selikoff ]
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Um, there might be such a thing. Never tried it, just googled it:
OracleJVM and Java Stored Procedures
Since Oracle8i, the Oracle database embeds a Java VM, which lets you run Java directly in the database. Java in the database is a response to customers in quest for portability, reuse and the ability to do things that cannot be done in PL/SQL (a lot of things!). Java can be migrated to/from middle-tier (J2EE, POJOS, JDBC) to the database (Java stored procedures) and vice versa. Other important benefits Java brings are the ability to just reuse, the huge Java class libraries produced over years by millions of developers; and also the pervasive Java skills.

From: http://www.oracle.com/technology/tech/java/jsp/index.html


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
I think you might have more luck getting an answer to your question at an Oracle site.
I remember Oracle once had a drive to be "300%" Java. That's not new math!
Just 100% Java on every tier...


There is no emoticon for what I am feeling!
 
GeeCON Prague 2014
 
subject: How to load a Java application to Oracle DB