code: public static String normalizeSQLIdentifier(String id) {
          if (id.length() == 0) {
              return id;
          }
  
          if (id.charAt(0) == '"'
                  && id.length() >= 3
                  && id.charAt(id.length() - 1) == '"') {
              // assume syntax is OK, thats is, any quotes inside are doubled:
  
              return StringUtil.compressQuotes(
                      id.substring(1, id.length() - 1), "\"\"");
  
          } else {
              return StringUtil.SQLToUpperCase(id);
          }
      }
docs: Normalize a SQL identifer, up-casing if <regular identifer>,
  and handling of <delimited identifer> (SQL 2003, section 5.2).
  The normal form is used internally in Derby.
  
  @param id syntacically correct SQL identifier