List of utility methods to do SQL Type
String | sqlTypeToSetterGetter(int sqlType) sql Type To Setter Getter switch (sqlType) { case Types.BIT: return "Boolean"; case Types.TINYINT: return "Boolean"; case Types.SMALLINT: return "Short"; case Types.INTEGER: ... |
String | sqlTypeToSqlTypeName(final int type) sql Type To Sql Type Name try { final Integer typeValue = new Integer(type); final Field[] fields = Types.class.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { final Field field = fields[i]; final Integer l = (Integer) field.get(null); if (typeValue.equals(l)) { return field.getName(); ... |
Class> | toClass(final int type) Translates a data type from an integer (java.sql.Types value) to a class type. Class<?> result = null; switch (type) { case Types.CHAR: result = Character.class; break; case Types.VARCHAR: case Types.LONGVARCHAR: result = String.class; ... |
Class | toClass(int sqlType, boolean isUnsigned) to Class return toClass(sqlType, -1, isUnsigned);
|
String | toHCatType(int sqlType) Resolve a database-specific type to HCat data type. switch (sqlType) { case Types.SMALLINT: case Types.TINYINT: case Types.INTEGER: return "int"; case Types.VARCHAR: return "varchar"; case Types.CHAR: ... |
Class> | toJavaType(int sqlType, String type) to Java Type switch (sqlType) { case Types.ARRAY: return Array.class; case Types.BIGINT: return Long.class; case Types.BINARY: case Types.LONGVARBINARY: case Types.VARBINARY: ... |
int | toOdaDataType(Class odiTypeClass) Converts an ODI type class to its corresponding ODA data type code. int odaType = Types.CHAR; if (odiTypeClass == null) odaType = Types.CHAR; else if (odiTypeClass == String.class) odaType = Types.CHAR; else if (odiTypeClass == Integer.class) odaType = Types.INTEGER; else if (odiTypeClass == Double.class) ... |
int | toSqlType(Class> clazz) to Sql Type if (clazz == String.class) { return Types.VARCHAR; if (clazz == Float.class) { return Types.FLOAT; if (clazz == Double.class) { return Types.DOUBLE; ... |
int | toSqlType(String clickshouseType) to Sql Type if (isNullable(clickshouseType)) { clickshouseType = unwrapNullable(clickshouseType); if (clickshouseType.startsWith("Int") || clickshouseType.startsWith("UInt")) { return clickshouseType.endsWith("64") ? Types.BIGINT : Types.INTEGER; if ("String".equals(clickshouseType)) return Types.VARCHAR; ... |
int | toSqlType(String clickshouseType) to Sql Type if (clickshouseType.startsWith("Int") || clickshouseType.startsWith("UInt")) { return clickshouseType.endsWith("64") ? Types.BIGINT : Types.INTEGER; if ("String".equals(clickshouseType)) return Types.VARCHAR; if (clickshouseType.startsWith("Float")) return Types.FLOAT; if ("Date".equals(clickshouseType)) ... |