public static int getTypeIdForObject()

in src/main/java/com/aliyun/ha3engine/jdbc/common/utils/TypeUtils.java [54:111]


    public static int getTypeIdForObject(Object c) {
        if (c instanceof Long) {
            return Types.BIGINT;
        }
        if (c instanceof Boolean) {
            return Types.BOOLEAN;
        }
        if (c instanceof Character) {
            return Types.CHAR;
        }
        if (c instanceof java.sql.Date) {
            return Types.DATE;
        }
        if (c instanceof java.util.Date) {
            return Types.TIMESTAMP;
        }
        if (c instanceof Double) {
            return Types.DOUBLE;
        }
        if (c instanceof Integer) {
            return Types.INTEGER;
        }
        if (c instanceof BigDecimal) {
            return Types.NUMERIC;
        }
        if (c instanceof Short) {
            return Types.SMALLINT;
        }
        if (c instanceof Float) {
            return Types.FLOAT;
        }
        if (c instanceof String) {
            return Types.VARCHAR;
        }
        if (c instanceof Time) {
            return Types.TIME;
        }
        if (c instanceof Timestamp) {
            return Types.TIMESTAMP;
        }
        if (c instanceof Byte) {
            return Types.TINYINT;
        }
        if (c instanceof Byte[]) {
            return Types.VARBINARY;
        }
        if (c instanceof Object[]) {
            return Types.JAVA_OBJECT;
        }
        if (c instanceof Object) {
            return Types.JAVA_OBJECT;
        }
        if (c instanceof Array) {
            return Types.ARRAY;
        } else {
            return Types.OTHER;
        }
    }