-
I need help on jow to execute a simple java procedure.
BY THE WAY, IM NEW IN THE JAVA WORLD...
check this out...
SQL> create or replace and compile java source named "first"
2 as
3 public class first
4 {
5 public static void main (String args[])
6 {
7 System.out.println("This is my fisrt jsp!!!");
8 }
9 }
10 /
Java created.
SQL> create or replace procedure proc_first as language java name 'Premier.main';
2 /
Warning: Procedure created with compilation errors.
SQL> show err;
Errors for PROCEDURE PROC_FIRST:
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 PL/SQL: Compilation unit analysis terminated
1/39 PLS-00311: the declaration of "Premier.main" is incomplete or
malformed
-
When compiling java, that is, going from the .java to .class files, the name of the .java file and the class declared inside need to be the same.
Perhaps that is the problem.
David Knight
OCP DBA 8i, 9i, 10g
-
hi this shld help u
SET SERVEROUT ON
CREATE OR REPLACE AND COMPILE JAVA SOURCE
NAMED "test"
AS
import java.util.*;
public class test
{
public static void test (String name,int num)
{
int i = 1;
int s = i + num ;
System.out.println("b4"+i +"i..............num"+num);
String prtString="Hello Useless "+name +"...."+num;
System.out.println("after"+i +"i..............num"+num);
System.out.println(prtString);
}
}
/
CREATE OR REPLACE PROCEDURE test(name varchar2,i number)
AS LANGUAGE JAVA
NAME 'test.test(java.lang.String,int)';
/
CALL dbms_java.set_output(1000);
/
CALL test('jegan',10);
Cheers!
OraKid.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|