cancel
Showing results for 
Search instead for 
Did you mean: 

Java in the database: ClassNotFoundException

Former Member
0 Kudos
2,539

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)

0 Kudos

If you run SELECT * FROM SYSJAVACLASS can you see the class there? Does the class_name match MyTestStoreProc?

Former Member
0 Kudos

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!

Accepted Solutions (0)

Answers (0)