Home arrow Java arrow Page 3 - Java Stored Procedure in Oracle, Database Interaction

Java Stored Procedure in Oracle, Database Interaction

In this article, we will examine working with Java Stored Procedures in Oracle database.

Author Info:
By: Jagadish Chaterjee
Rating: 4 stars4 stars4 stars4 stars4 stars / 34
November 01, 2005
  1. · Java Stored Procedure in Oracle, Database Interaction
  2. · A Simple Java Class
  3. · Getting Java Classes into Oracle Database
  4. · How to make Classes available to Oracle
  5. · How to execute the Java Stored Procedures

print this article

Java Stored Procedure in Oracle, Database Interaction - Getting Java Classes into Oracle Database
(Page 3 of 5 )

The simple Java class we created in the previous section needs to become a full-fledged schema object before it could be accessed, as if it is a native stored procedure.  Oracle provides a command-line utility called “loadjava” to accomplish this task. The “loadjava” utility essentially provides an interface for SQL based CREATE JAVA statements, which also may be used to migrate Java-related files to the database.

We need not compile the previous program using the traditional “javac” compiler;  “loadjava” does even that for us during its loading process. This is achieved by specifying the -resolve attribute on the utility.

$ loadjava -u scott/tiger -v -resolve Employee.java

The following commands would help you to know the status of what you created.

SELECT object_name, object_type, status
FROM user_objects WHERE object_type LIKE 'JAVA%';

You should attain the “VALID” in the output.  Otherwise something is wrong with your program.  If you receive any errors, you should query “USER_ERRORS” to view more information and correct them accordingly.

blog comments powered by Disqus

- Java Too Insecure, Says Microsoft Researcher
- Google Beats Oracle in Java Ruling
- Deploying Multiple Java Applets as One
- Deploying Java Applets
- Understanding Deployment Frameworks
- Database Programming in Java Using JDBC
- Extension Interfaces and SAX
- Entities, Handlers and SAX
- Advanced SAX
- Conversions and Java Print Streams
- Formatters and Java Print Streams
- Java Print Streams
- Wildcards, Arrays, and Generics in Java
- Wildcards and Generic Methods in Java
- Finishing the Project: Java Web Development ...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials