code: public static String[] quotelessTableName(String fullname) {
  
      String[] parts = new String[]{null, ""};
      StringBuilder acc = new StringBuilder();
      boolean betweenQuotes = false;
      for (int i = 0; i < fullname.length(); i++) {
        char c = fullname.charAt(i);
        switch (c) {
          case '"':
            if ((i < fullname.length() - 1) && (fullname.charAt(i + 1) == '"')) {
              // two consecutive quotes - keep one
              i++;
              acc.append(c); // keep the quote
            } else { // Discard it
              betweenQuotes = !betweenQuotes;
            }
            break;
          case '.':
            if (betweenQuotes) { // Keep it
              acc.append(c);
            } else { // Have schema name
              parts[1] = acc.toString();
              acc = new StringBuilder();
            }
            break;
          default:
            acc.append((betweenQuotes) ? c : Character.toLowerCase(c));
            break;
        }
      }
      // Always put table in slot 0
      parts[0] = acc.toString();
      return parts;
    }
docs: Cracks out the table name and schema (if it exists) from a fully qualified table name.
  
  @param fullname string that we are trying to crack. Test cases:
  
  <pre>
  
  Table: table
  ()
  
  "Table": Table
  ()
  
  Schema.Table:
  table (schema)
  
  "Schema"."Table": Table
  (Schema)
  
  "Schema"."Dot.Table": Dot.Table
  (Schema)
  
  Schema."Dot.Table": Dot.Table
  (schema)
  
  </pre>
  
  @return String array with element zero always being the tablename and element 1 the schema name
  which may be a zero length string.