Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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%20G's gravatar image

M G
629253044
accept rate: 42%

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

(07 Jan '14, 08:21) Mikel Rychliski

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!

(07 Jan '14, 08:43) M G
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×261
×95
×78

question asked: 07 Jan '14, 08:06

question was seen: 2,283 times

last updated: 07 Jan '14, 08:43