Пример #1
0
 public int getFieldJdbcType(int fieldOrdinal) {
   RelDataType type = getFieldNamedType(fieldOrdinal);
   SqlTypeName typeName = type.getSqlTypeName();
   if (typeName == null) {
     return Types.OTHER;
   }
   return typeName.getJdbcOrdinal();
 }
Пример #2
0
 public int getFieldScale(int fieldOrdinal) {
   RelDataType type = getFieldType(fieldOrdinal);
   SqlTypeName typeName = type.getSqlTypeName();
   if (typeName == null) {
     return 0;
   }
   if (typeName.allowsPrecScale(true, true)) {
     return type.getScale();
   } else {
     return 0;
   }
 }
Пример #3
0
 public String getFieldTypeName(int fieldOrdinal) {
   RelDataType type = getFieldNamedType(fieldOrdinal);
   SqlTypeName typeName = type.getSqlTypeName();
   if (typeName == null) {
     return type.toString();
   }
   switch (typeName) {
     case STRUCTURED:
     case DISTINCT:
       return type.getSqlIdentifier().toString();
     case INTERVAL_DAY_TIME:
     case INTERVAL_YEAR_MONTH:
       return type.toString();
   }
   return typeName.name();
 }