Hi! I have some trouble with java store procedures(SQL ANywhere 16, windows)and would be very happy if someone could help me When I try to run my java stored procedure (CALL MyMain('2013-01-07');) I get this error: Could not execute statement Procedure 'MyMain' terminated with unhandled exception 'java.lang.ClassNotFoundException: MyTestStoreProc' SQLCODE = -91, ODBC 3 Sate = "HY000" Line 1, column1 I created the wrapper like this CREATE PROCEDURE MyMain( IN arg1 CHAR(50) ) EXTERNAL NAME 'MyTestStoreProc.main([Ljava/lang/String;)V' LANGUAGE JAVA; You can see the class in Sybase central (External environments) and the wrapper (procedures and functions), So it looks ok So I do not understand why I get this error...Can anybody please give me some pointers? (The procedures in the class can be executed from eclipse without any errors) asked 07 Jan '14, 08:06 M G |
If you run SELECT * FROM SYSJAVACLASS can you see the class there? Does the class_name match MyTestStoreProc?
yes I can see the class there, but I does not completley match the class name, instead it says "MyTestStoreProc.MyTestStoreProc", I forgot that the class is included in a package called MyTestStoreProc so in the wrapper I must write
CREATE PROCEDURE MyMain( IN arg1 CHAR(50) ) EXTERNAL NAME 'MyTestStoreProc.MyTestStoreProc.main([Ljava/lang/String;)V' LANGUAGE JAVA;
and now it works
thanks for your help!