How to get array from append array

import de.bezier.data.sql.*;

String dbHost = "localhost"; // if you are using a using a local database, this should be fine
String dbPort = "3306"; // replace with database port, MAMP standard is 8889
String dbUser = "root"; // replace with database username, MAMP standard is "root"
String dbPass = "";  // replace with database password, MAMP standard is "root"
String dbName = "tes"; // replace with database name
String user = "ebbg678";
String[] status={};
String[] username={};
String[] userON={};
MySQL msql;

void setup() {
  msql = new MySQL( this, dbHost + ":" + dbPort, dbName, dbUser, dbPass );

  if (msql.connect()) {
    msql.query("SELECT * FROM tes");
    while (msql.next()) {
      status = append (status, msql.getString("STATUS"));
      username = append (username, msql.getString("USERNAME"));
      for (int i = 0; i < username.length; i++) {
        if (status[i] == "ON") {
          userON = append (userON, username[i]);
        }
      }
    }
  } else {
    println("Yikes, there was an error!");
  }
  print(userON[0]);
}

please help i can’t append my array string from my database. Where did i go wrong?