Hi All,!_NEWLINE_!!_NEWLINE_!I have a Java Application which references...
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Suraj_Kumar
Posted On:   Tuesday, February 20, 2001 02:38 PM

Hi All, I have a Java Application which references many other classes, including that of mine. The objective is to create a Java Stored Procedure out of it. I have loaded all the classes referenced by it to the databases using loadjava using -resolve option. It all went smoothly. Problem : The Java application's main() method accepts 4 command line arguments and I, there fore, published the main() method of my class MyClass.class with the call spec as follows: CREATE OR REPLACE PROCEDURE My_Class ( s1 VARCHAR2, s2 VARCHAR2, s3 VARCHAR2, s4 VARCHAR2) AS LANGUAGE JAVA NAME ’MyClass.main(java.lang.String[])’; .This command created th   More>>

Hi All,

I have a Java Application which references many other classes, including that of mine.

The objective is to create a Java Stored Procedure out of it. I have loaded all the classes referenced by it to the databases using loadjava using -resolve option. It all went smoothly.

Problem :

The Java application's main() method accepts 4 command line arguments and I, there fore, published the main() method of my class MyClass.class with the
call spec as follows:

CREATE OR REPLACE PROCEDURE My_Class (
s1 VARCHAR2,
s2 VARCHAR2,
s3 VARCHAR2,
s4 VARCHAR2)
AS LANGUAGE JAVA
NAME ’MyClass.main(java.lang.String[])’;

.This command created the procedure successfully.

Now, when I try to call my procedure from SQL prompt as:

SQL> call My_Class.main('10.42.53.45','Web Sales','','http://localhost/apps/qantasideal/qasartomad.xml'),

I get the error:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.ExceptionInInitializerError.

Please note that the same class I execute from JDE as follows:
c:> MyClass '10.42.53.45','Web Sales' '' 'http://localhost/apps/qantasideal/qasartomad.xml' .

It works smoothly.

Thearitically, the 4 argument to the procedure My_Class should map to the 4 arguments of the main() method.

I cannot find any proper explanation to the above problems at Oracle site.

I have Oracle 8.1.6 with the same version of JServer on NT, for test purposes.

Any information on the above will be highly appreciated.


Note: The overall objective is to call a complete Java Application from a Database Trigger.


Regards,
Suraj Kumar
Email: surajkunnath@hotmail.com

   <<Less
About | Sitemap | Contact