java uid及plsql呼叫

zgy13121發表於2011-09-22

package com.azhu.test;
import java.rmi.server.UID;;
public class Uid {
//private UID uid=new UID();
public static void main(String[] args){
System.out.println("test");
for(int i=0;i<10;i++){
System.out.println(getUid());
}
}

public static String getUid(){
return new UID().toString();
}

}

[@more@]

ORACLE 資料庫java:

create or replace and compile java source named javaUtils as
import java.rmi.server.UID;
public class JavaUtils
{
public static String getUID()
{
return new UID().toString();
}
}

建函式呼叫

create or replace function getuid
return varchar2
as
language java
name 'JavaUtils.getUID() return java.lang.String';

呼叫方式

select getuid from dual;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11419868/viewspace-1055253/,如需轉載,請註明出處,否則將追究法律責任。

相關文章