/** * Overwrite the user name. The user name is case-insensitive and stored in * uppercase. English conversion is used. * * @param name the user name */ public void setUserName(String name) { this.user = StringUtils.toUpperEnglish(name); }
/** * Check if a given string is a valid date part string. * * @param part the string * @return true if it is */ public static boolean isDatePart(String part) { Integer p = DATE_PART.get(StringUtils.toUpperEnglish(part)); return p != null; }
/** * Get the mode with the given name. * * @param name the name of the mode * @return the mode object */ public static Mode getInstance(String name) { return MODES.get(StringUtils.toUpperEnglish(name)); }
private static String toUpper(Object key) { return key == null ? null : StringUtils.toUpperEnglish(key.toString()); }
private static String toUpper(Object key) { return key == null ? null : StringUtils.toUpperEnglish(key.toString()); }
private static void add(Mode mode) { MODES.put(StringUtils.toUpperEnglish(mode.name), mode); }
private static int getDatePart(String part) { Integer p = DATE_PART.get(StringUtils.toUpperEnglish(part)); if (p == null) { throw DbException.getInvalidValueException("date part", part); } return p.intValue(); }
private int getAggregateType(String name) { if (!identifiersToUpper) { // if not yet converted to uppercase, do it now name = StringUtils.toUpperEnglish(name); } return Aggregate.getAggregateType(name); }
private boolean isKeyword(String s) { if (!identifiersToUpper) { // if not yet converted to uppercase, do it now s = StringUtils.toUpperEnglish(s); } return isKeyword(s, false); }
/** * Get the collation name. * * @param l the locale * @return the name of the collation */ public static String getName(Locale l) { Locale english = Locale.ENGLISH; String name = l.getDisplayLanguage(english) + ' ' + l.getDisplayCountry(english) + ' ' + l.getVariant(); name = StringUtils.toUpperEnglish(name.trim().replace(' ', '_')); return name; }
/** * INTERNAL */ public static int getCompressAlgorithm(String algorithm) { algorithm = StringUtils.toUpperEnglish(algorithm); if ("NO".equals(algorithm)) { return Compressor.NO; } else if ("LZF".equals(algorithm)) { return Compressor.LZF; } else if ("DEFLATE".equals(algorithm)) { return Compressor.DEFLATE; } else { throw DbException.get(ErrorCode.UNSUPPORTED_COMPRESSION_ALGORITHM_1, algorithm); } }
private int getTokenType(String s) { int len = s.length(); if (len == 0) { throw getSyntaxError(); } if (!identifiersToUpper) { // if not yet converted to uppercase, do it now s = StringUtils.toUpperEnglish(s); } return getSaveTokenType(s, database.getMode().supportOffsetFetch); }
public void addProperty(String key, String value, boolean checkDuplicate) { key = StringUtils.toUpperEnglish(key); if (checkDuplicate) { String old = prop.getProperty(key); if (old != null) { if (!old.equals(value)) { throw DbException.get(ErrorCode.DUPLICATE_PROPERTY_1, key); } return; } } if (isKnownSetting(key)) { prop.put(key, value); } else { throw DbException.get(ErrorCode.UNSUPPORTED_SETTING_1, key); } }
while (rs.next()) { String c = rs.getString("COLUMN_NAME"); key.add(toUpper ? StringUtils.toUpperEnglish(c) : c); key.add(toUpper ? StringUtils.toUpperEnglish(c) : c);
String c = StringUtils.toUpperEnglish(result.getAlias(i)); mapColumn(map, c, i); String colName = result.getColumnName(i); if (colName != null) { colName = StringUtils.toUpperEnglish(colName); mapColumn(map, colName, i); String tabName = result.getTableName(i); if (tabName != null) { colName = StringUtils.toUpperEnglish(tabName) + "." + colName; mapColumn(map, colName, i); Integer index = columnLabelMap.get(StringUtils.toUpperEnglish(columnLabel)); if (index == null) { throw DbException.get(ErrorCode.COLUMN_NOT_FOUND_1, columnLabel);
/** * Get an instance of the given function for this database. * If no function with this name is found, null is returned. * * @param database the database * @param name the function name * @return the function object or null */ public static Function getFunction(Database database, String name) { if (!database.getSettings().databaseToUpper) { // if not yet converted to uppercase, do it now name = StringUtils.toUpperEnglish(name); } FunctionInfo info = getFunctionInfo(name); if (info == null) { return null; } switch (info.type) { case TABLE: case TABLE_DISTINCT: return new TableFunction(database, info, Long.MAX_VALUE); default: return new Function(database, info); } }
schemaName = StringUtils.toUpperEnglish(schemaName); s = database.getSchema(schemaName); sequenceName = StringUtils.toUpperEnglish(sequenceName); seq = s.getSequence(sequenceName);
String originalURL = transfer.readString(); String userName = transfer.readString(); userName = StringUtils.toUpperEnglish(userName); Session session = createSession(transfer, sessionId, originalURL, dbName, userName); transfer.setSession(session);
DataType dataType; if (!identifiersToUpper) { original = StringUtils.toUpperEnglish(original);