需要在oracle 中执行"call dbms_java.set_output(5000);".
一、helloWord
1 编写JAVA程序,也是在SQL/PLUS中写,并执行.
create or replace and compile java source named hello as public class Hello { static public String Message(String name) { return " Hello, " + name; } }
2 发布JAVA程序
create or replace function hello (name VARCHAR2 ) return VARCHAR2 as language java name ' Hello.Message (java.lang.String) return java.lang.String ' ;
3 使用发面的JAVA程序
select hello( ' world! ' ) from dual;
HELLO( ' world! ' )
-- -------------
Hello world!