Oracle - JSERVER - How to get the Java Version ?

> Database > Oracle Database

1 - About

How to get the java version of JSERVER ? (Not sure …)

3 - Steps

3.1 - The java class

package com.gerardnico;
 
public class Version {
 
	  public static String getJavaVersion() 
	  {
	    String JAVAversion = System.getProperty("java.version");
	    System.out.println("The version of JAVA is: "+JAVAversion);
	    return JAVAversion;
	  }
 
}

3.2 - Publish the java class

CREATE OR REPLACE FUNCTION getJavaVersion RETURN VARCHAR2 IS LANGUAGE JAVA NAME 
'com.gerardnico.Version.getJavaVersion() return java.lang.String';

3.3 - Get the java version

SQL> SELECT getJavaVersion() FROM dual;
 
GETJAVAVERSION()
-----------------------------------------
 
1.4.2_04
Advertising
db/oracle/java_getversion.txt · Last modified: 2017/09/06 19:28 by gerardnico