日期:2014-05-16  浏览次数:20379 次

oracle如何取得uuId

是想生成GUID吗?
SQL> select sys_guid() from dual
;

SYS_GUID()
--------------------------------
F18031C69D8345DEB305D4B2E796A282


-------------------------------------------------java取得uuid


package com.hdsoft.uuid;


import java.util.UUID;


public class IdGenerate {


/**
* @param args
*/


public static String getUUIDString() {
String id =
UUID.randomUUID().toString();
id = id.replace("-", "");
return
id;
}


public static void main(String[] args) {
// TODO Auto-generated method
stub
System.out.println(IdGenerate.getUUIDString());
}


}