T100738
2024-04-16 eeb86aaf2f73a02600195ce2637dde6caf858a88
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package com.product.data.center.utils;
 
import com.product.datasource.config.DataBaseType;
 
/**
 * @Author cheng
 * @Date 2022/7/14 10:48
 * @PackageName:com.product.data.center.utils
 * @ClassName: BatchUtils
 * @Description:
 * @Version 1.0
 */
public class BatchUtils {
 
    public static String getFieldName(String fieldName, DataBaseType dbe) {
        switch (dbe) {
            case MYSQL:
                return "`" + fieldName + "`";
            case SQLSERVER:
                return "[" + fieldName + "]";
            case ORACLE:
                return "\"" + fieldName.toUpperCase() + '\"';
            case PSQL:
                return "\"" + fieldName + '\"';
            case INFORMIX:
                //todo
        }
        return fieldName;
    }
}