Friday, September 27, 2013

Java Version in Oracle 12c

Oracle has had an embedded Java Virtual Machine (JVM) for several years, but it has always been a bit behind the current release of Java.  Prior to Oracle 11g, Java 1.4 JVM was the latest available and was called the Aurora JVM, in Oracle.  In Oracle 11g, finally Java 1.5 JVM was available, and it was based on the Java Security features of that release that I wrote my book, “Expert Oracle and Java Security”.  Now the production release of Oracle 12c is available, and the first thing I wanted to know is what version of the JVM was included.

To test what version of Java is available in Oracle 12c, I wrote this small Java class, and a Java Stored Procedure (Function) to encapsulate it.

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED JSProc AS
public class JavaStoredProcedures {
    public static String getVersion() {
        return System.getProperty("java.version");
    }
}
/


CREATE OR REPLACE FUNCTION f_get_java_version
    RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'JavaStoredProcedures.getVersion() return java.String';


Running the Java Stored Procedure, I found that Java 1.6 was available in Oracle 12c. Yay!  Even though 1.7 is out and 1.8 is coming soon, new encryption algorithms that I pre-programmed for in the code of my book are now supported with 1.6, along with even more secure algorithms.  This is great!

SELECT f_get_java_version FROM DUAL;
-- 1.6.0 --

Cleaning up after running my Java Stored Procedure requires removing the function and the Java class.  Cleaning up after ourselves is part of good, secure programming.

DROP FUNCTION f_get_java_version;

DROP JAVA SOURCE JSProc;

1 comment:


  1. I like your post very much. It is very much useful for my research. I hope you to share more info about this. Keep posting java online course

    ReplyDelete