private static DataType createString(boolean caseSensitive) { DataType dataType = new DataType(); dataType.prefix = "'"; dataType.suffix = "'"; dataType.params = "LENGTH"; dataType.caseSensitive = caseSensitive; dataType.supportsPrecision = true; dataType.maxPrecision = Integer.MAX_VALUE; dataType.defaultPrecision = Integer.MAX_VALUE; dataType.defaultDisplaySize = Integer.MAX_VALUE; return dataType; }
private static DataType createDate(int precision, String prefix, int scale, int displaySize) { DataType dataType = new DataType(); dataType.prefix = prefix + " '"; dataType.suffix = "'"; dataType.maxPrecision = precision; dataType.supportsScale = scale != 0; dataType.maxScale = scale; dataType.defaultPrecision = precision; dataType.defaultScale = scale; dataType.defaultDisplaySize = displaySize; return dataType; }
private static DataType createDecimal(int maxPrecision, int defaultPrecision, int defaultScale, int defaultDisplaySize, boolean needsPrecisionAndScale, boolean autoInc) { DataType dataType = new DataType(); dataType.maxPrecision = maxPrecision; dataType.defaultPrecision = defaultPrecision; dataType.defaultScale = defaultScale; dataType.defaultDisplaySize = defaultDisplaySize; if (needsPrecisionAndScale) { dataType.params = "PRECISION,SCALE"; dataType.supportsPrecision = true; dataType.supportsScale = true; } dataType.decimal = true; dataType.autoIncrement = autoInc; return dataType; }
private static void add(int type, int sqlType, String jdbc, DataType dataType, String[] names, int memory) { for (int i = 0; i < names.length; i++) { DataType dt = new DataType(); dt.type = type; dt.sqlType = sqlType;