title: Java array records
body: <p>I need to get an variable type that has 3 types of values, the only way I know to do that is "Records", but I know there is no such type as "Records" in Java but <code>ArrayList</code>, but I don't get it...</p>
  
  <p>My result should be: (Don't know how it would look in Java, so I'm showing in different style)</p>
  
  <pre><code>TData = Record
       Username : String;
       UserID : Int ;
       RowID : Int;
     end;
  users : array[1..10] of TData;
  
  for(int i = 1; i &lt; rowCount; i++){
     TData.Username[i] = rs.GetString("Name");
     TData.UserID[i] = rs.GetInt("UserID");
     TData.RowID[i] = row;
  }
  </code></pre>
  
  <p>Any suggestions on how to make something like this?
  Is <code>ArrayList</code> that I really need?</p>
  
  <p>Thanks for the help, at the end i combined and got this result, works perfectly:</p>
  
  <pre><code>class MyData {
          private String userName;
          private int userID;
          private int RowID;
  
  
          public MyData(String userName, int userID, int RowID) {
              this.userName = userName;
              this.userID = userID;
              this.RowID = RowID;
          }
  
          public String getUserName() {
              return userName;
          }
  
          public int getUserID() {
              return userID;
          }
          public int getRowID() {
              return RowID;
          }
      }
  
      public void AList(){
          ArrayList&lt;MyData&gt; users = new ArrayList&lt;&gt;();
          try{
              conn = DBConnection.DBConnector();
              pst = conn.prepareStatement("SELECT * FROM TableUserData");
              rs = pst.executeQuery();
              row = 0;
              while (rs.next()) {
                  users.add(new MyData(rs.getString("User_name"), rs.getInt("ID"), row));
                  row++;
                  }
              for (MyData tmp : users) {
                  JOptionPane.showMessageDialog(null, "Users: " + tmp.getUserName() + " row: " + rtmp.getRowID());
  
              }
  
          }catch(Exception e){
              JOptionPane.showMessageDialog(null, "Arraylist error: " + e);
          }
  
      }
  </code></pre>