I will present how to print System.getProperties() in Java and call it from PLSQL.
I can print output in DBMS Output Console or Java Console.
The steps of this practice as below
1-Create Java Class
2-Create wrapper Procedure and Function
3-Call Wrapper Procedure and Function From PLSQL
a-printProperties method which return output of system properties as string
b-printPropertiesJavaConsole method which print output of system properties in Java console
I can print output in DBMS Output Console or Java Console.
The steps of this practice as below
1-Create Java Class
2-Create wrapper Procedure and Function
3-Call Wrapper Procedure and Function From PLSQL
1-Create Java Class
I create two method in Java Classa-printProperties method which return output of system properties as string
b-printPropertiesJavaConsole method which print output of system properties in Java console
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED SystemProperties
AS import java.util.Enumeration;
import java.util.Properties;
public class SystemProperties {
public static String printProperties() {
StringBuilder sb = new StringBuilder();
Properties properties = System.getProperties();
Enumeration properiesEnum = properties.propertyNames();
while (properiesEnum.hasMoreElements()) {
String propertyKey = (String)properiesEnum.nextElement();
sb.append(propertyKey + " = " + System.getProperty(propertyKey) + "\n");
}
return sb.toString();
}
public static void printPropertiesJavaConsole() {
System.out.println(printProperties());
}
public static void main(String[] args) {
System.out.println(printProperties());
}
}
/