在Oracle中写java代码有木有?
有的,亲。
如图:
AA:
create or replace and compile java source named aa as
public class AA
{
public static int getid()
{
return 1;
}
}
FN_AA:
create or replace function FN_AA return number as
LANGUAGE JAVA NAME 'AA.getid() return java.lang.Integer';
调用测试:
declare
begin
dbms_output.put_line(FN_AA());
end;
输出:
1