yuxc
2025-01-07 1f7fb3d9affd85a327d6baa60bb3fd32943ef5c4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.vci.common.exception;
 
public class ORAUniqueProperties {    
    
    public static String getUniqueIndexName(Object obj) {
        String index = "";
        try {
            String str = obj.toString();
            if (str.indexOf("ORA-00001") < 0) {
                return "";
            }
            index = str.substring(str.indexOf("(") + 1, str.indexOf(")"));
            index = index.substring(index.indexOf(".") + 1);
        } catch (Exception e) {
            e.printStackTrace();
            index = "";
        }
        return index;
    }
}