2010.09.13——— oracle获得uuid 以及 java生成uuid
1. oracle获得uuid
- SQL> select sys_guid() from dual ;
-
- SYS_GUID()
- --------------------------------
- F18031C69D8345DEB305D4B2E796A282
SQL> select sys_guid() from dual ;
SYS_GUID()
--------------------------------
F18031C69D8345DEB305D4B2E796A282
2. java生成uuid
- import java.util.UUID;
-
- public class IdGenerate {
-
- public static String getUUIDString() {
- String id = UUID.randomUUID().toString();
- id = id.replace("-", "");
- return id;
- }
-
- public static void main(String[] args) {
- System.out.println(IdGenerate.getUUIDString());
- }
-
- }