- 论坛徽章:
- 0
|
本帖最后由 zwjwelch 于 2011-08-04 17:16 编辑
谢谢,请问sybase的自定义函数只能是java写的,然后再用installjava注册吗?
按照网上的文档,注册步骤是
java文件
package sam;
public class HelloWorld
{
public String Hello()
{
return "HelloWorld";
}
}
1.把java文件编译成class javac HelloWorld.java
2.把class文件打成jar包 jar cf0 sam.jar HelloWorld.class
3.installjava -f '/home/welch3/code/test/testc/sam.jar' -j -new -S puple -U sa -P 123456 -D
能注册上但是报这个信息
Server Message: puple - Msg 10796, Level 10, State 1:
Warning! Expecting file 'HelloWorld.class' to contain Java class 'HelloWorld'. Instead, class 'sam.HelloWorld' was found. Installing the class under the correct name 'sam.HelloWorld'.
然后调用
1> select (new sam.HelloWorld())>>Hello()
2> go
报错
Msg 10707, Level 16, State 1:
Server 'puple', Line 1:
Unhandled Java Exception:
java.lang.ClassFormatError: sam.HelloWorld
.
不知道咋回事... |
|