List of utility methods to do SQL Type
String | getJavaTypeFromSqlType(int sqlType) get Java Type From Sql Type String jtype; switch (sqlType) { case Types.BIT: jtype = "Boolean"; break; case Types.ARRAY: jtype = "Array"; break; ... |
Class | getJavaTypeNameByJdbcType(int jdbcType) get Java Type Name By Jdbc Type switch (jdbcType) { case Types.BIT: { return Boolean.class; case Types.TINYINT: { return Byte.class; case Types.SMALLINT: { ... |
int | getJdbcType(int firebirdType) get Jdbc Type switch (firebirdType) { case smallint_type: return Types.SMALLINT; case integer_type: return Types.INTEGER; case quad_type: return Types.ARRAY; case float_type: ... |
int | getJdbcType(String datatype) get Jdbc Type int jdbcType = 0; if ("BLOB".equals(datatype)) { jdbcType = Types.BLOB; } else if ("CHAR".equals(datatype)) { jdbcType = Types.CHAR; } else if ("CLOB".equals(datatype)) { jdbcType = Types.CLOB; } else if ("DATE".equals(datatype)) { ... |
int | getJdbcType(String typeName) get Jdbc Type Integer answer = nameToType.get(typeName); if (answer == null) { answer = Types.OTHER; return answer; |
Class> | getJdbcTypeClass(int type) get Jdbc Type Class Class<?> result = Object.class; switch (type) { case Types.CHAR: case Types.VARCHAR: case Types.LONGVARCHAR: case Types.CLOB: result = String.class; break; ... |
int | getJDBCTypeForNamedType(String aTypeName) Gets the JDBC datatype identifier corresponding to the given named datatype. int jdbcTypeID = 0; if (aTypeName.equalsIgnoreCase(TYPENAME_INTEGER) || aTypeName.equalsIgnoreCase(TYPENAME_INT)) { jdbcTypeID = java.sql.Types.INTEGER; } else if (aTypeName.equalsIgnoreCase(TYPENAME_DECIMAL) || aTypeName.equalsIgnoreCase(TYPENAME_DEC) || aTypeName.equalsIgnoreCase(TYPENAME_NUMERIC) || aTypeName.equalsIgnoreCase("NUM")) { jdbcTypeID = java.sql.Types.DECIMAL; } else if (aTypeName.equalsIgnoreCase(TYPENAME_VARCHAR) || aTypeName.equalsIgnoreCase(TYPENAME_CHARACTER_VARYING) ... |
String | getJdbcTypeName(int jdbcType) get Jdbc Type Name if (map != null) return (String) map.get(new Integer(jdbcType)); map = new HashMap(); Field[] fields = java.sql.Types.class.getFields(); for (int i = 0; i < fields.length; i++) { try { String name = fields[i].getName(); Integer value = (Integer) fields[i].get(null); ... |
String | getJDBCTypeName(int value) get JDBC Type Name if (jdbcTypeValues == null) { jdbcTypeValues = new HashMap<Object, String>(); Field[] fields = Types.class.getFields(); for (int i = 0; i < fields.length; i++) { Field field = fields[i]; if (Modifier.isStatic(field.getModifiers())) { try { jdbcTypeValues.put(field.get(Types.class), field.getName()); ... |
Map | getJdbcTypeNames() get Jdbc Type Names if (jdbcTypeNames == null) { Map<Integer, String> aux = new HashMap<>(); for (Field field : Types.class.getFields()) { try { aux.put((Integer) field.get(null), field.getName()); } catch (IllegalArgumentException iae) { } catch (IllegalAccessException iae) { jdbcTypeNames = aux; return jdbcTypeNames; |