Java, PL/SQL Proc [message #388653] |
Wed, 25 February 2009 20:44 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
wmgonzalbo
Messages: 98 Registered: November 2008
|
Member |
|
|
Hi Experts:
Opted to post this in this java boards instead of pl/sql.. Hope i did the right thing.. Anyway i'm just clueless right now..
I was given this java class / java file:
> Myclass.class
- takes and input like this:
public class Myclass {
public static void main(String[] args) {
.
.
.
}
}
- though it calls a package and other classes, and most likely these other classes are the ones returning a string output.
and i did these steps:
$ loadjava -user arbor Myclass.class
Password: password
SQL> EXECUTE DBMS_JAVA.GRANT_PERMISSION ('MYSHEMA', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'execute' )
PL/SQL procedure successfully completed.
SQL> EXECUTE DBMS_JAVA.GRANT_PERMISSION ('MYSHEMA', 'java.lang.RuntimePermission', '*', 'writeFileDescriptor' )
PL/SQL procedure successfully completed.
SQL> EXECUTE DBMS_JAVA.GRANT_PERMISSION ('MYSHEMA', 'java.lang.RuntimePermission', '*', 'readFileDescriptor' )
PL/SQL procedure successfully completed.
-----
SQL> create or replace procedure Myclass_Proc (p_args IN VARCHAR2)
2 AS LANGUAGE JAVA
3 NAME 'Myclass(java.lang.String)';
4 /
Warning: Procedure created with compilation errors.
SQL> sho err
Errors for PROCEDURE MYCLASS_PROC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
3/1 PLS-00311: the declaration of "Myclass(java.lang.String)"
is incomplete or malformed
-----
-- i also did these:
SQL> create or replace function Myclass_Func (p_args IN VARCHAR2)
2 RETURN VARCHAR2 AS LANGUAGE JAVA
3 NAME 'Myclass(java.lang.String) return java.lang.String';
4 /
Warning: Function created with compilation errors.
SQL> sho err
Errors for FUNCTION MYCLASS_FUNC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
3/1 PLS-00311: the declaration of "Myclass(java.lang.String) return java.lang.String"
is incomplete or malformed
Dont know if my error is on java or pl/sql, but most likely its in my format.. im just clueless right now, if you could help or suggest something i would really appreciate it..
Regards,
Wilbert
[Updated on: Wed, 25 February 2009 20:52] Report message to a moderator
|
|
|
|
Re: Java, PL/SQL Proc [message #388692 is a reply to message #388653] |
Wed, 25 February 2009 23:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
wmgonzalbo
Messages: 98 Registered: November 2008
|
Member |
|
|
Hi Michel C.,
Its seems there aren't any other function in the Myclass.class file.. just the main() and SEVERAL other import package.classes.. too bad i cant really post the java code itself in this thread, it would cause me alot of trouble..
even tried it this way:
SQL> create or replace function Myclass_Func (p_args IN VARCHAR2)
2 RETURN VARCHAR2 AS LANGUAGE JAVA
3 NAME 'Myclass.main(java.lang.String) return java.lang.String';
4 /
Warning: Function created with compilation errors.
SQL> sho err
Errors for FUNCTION MYCLASS_FUNC:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
3/1 PLS-00311: the declaration of "Myclass(java.lang.String) return java.lang.String"
is incomplete or malformed
i'm still looking into this java Myclass.class file, if i was the one who created it, it would much easier to debug, oh well these scenarios cant be helped in this line of work...
Regards,
Wilbert
|
|
|
|
|
|