主要是学习PL/SQL调用JAVA的方法.
平台:WINDOWS
1.首先使用IDE写好需要调用的java代码,再添加"create or replace and compile java source named 名字 as",然后在PL/SQL中执行
create or replace and compile java source named getosmac as
import java.io.InputStreamReader;
import java.io.LineNumberReader;
public class GetOSMac {
/**
* 获取MAC地址
*/
public static String getMac() {
String result = "";
try {
Process process = Runtime.getRuntime().exec("ipconfig /all");
/**
* 通过执行dos命令IPCONFIG / ALL来获取
*/
InputStreamReader ir = new InputStreamReader(
process.getInputStream());
LineNumberReader input = new LineNumberReader(ir);
String line;
while ((line = input.readLine()) != null)
if (line.indexOf("Physical Address") >