title: Java/MySql - getting a row and convert it to a arraylist<String>
body: <p>I am trying to get a row and convert it to a array I alredy tried to convert the resultset.getArray() to a ArrayList but for some reason it returned nothing somebody help me with this</p>
  
  <p>code now:</p>
  
  <pre><code>public ArrayList&lt;String&gt; getReport(String name) {
      try {
          Statement sql =  mySql.getConnection().createStatement();
          ResultSet resultSet = sql.executeQuery("SELECT * FROM `reports` WHERE `reportedplayer`='" + name + "';");
          if(!resultSet.next()) {
              sql.close();
              resultSet.close();
              return null;
          }
          ArrayList&lt;String&gt; rowValues = new ArrayList&lt;String&gt;();
          while (resultSet.next()) {
              rowValues.add(resultSet.getString("reason"));
          }
          sql.close();
          resultSet.close();
          return rowValues;
      }catch (SQLException e) {
          e.printStackTrace();
          return null;
      }
  }
  </code></pre>