SQL> create or replace and compile java source named java_version as
2 public class JavaVersion
3 {
4 public String Get()
5 {
6 String Version = System.getProperties().getProperty("java.version");
7 return Version;
8 }
9 }
10 /
Java created
SQL> CREATE OR REPLACE FUNCTION fnc_JavaVersion RETURN VARCHAR2 AS
2 LANGUAGE JAVA NAME 'JavaVersion.Get( ) return java.lang.String';
3 /
Function created
SQL> SELECT fnc_JavaVersion() FROM dual;
SELECT fnc_JavaVersion() FROM dual
ORA-29531: no method Get in class JavaVersion
SQL> create or replace and compile java source named java_version as
2 public class JavaVersion
3 {
4 public static String Get()
5 {
6 String Version = System.getProperties().getProperty("java.version");
7 return Version;
8 }
9 }
10 /
Java created
SQL> SELECT fnc_JavaVersion() FROM dual;
SELECT fnc_JavaVersion() FROM dual
ORA-29549: class SYSADM.JavaVersion has changed, Java session state cleared
SQL> SELECT fnc_JavaVersion() FROM dual;
FNC_JAVAVERSION()
--------------------------------------------------------------------------------
1.4.1
SQL>
No comments:
Post a Comment