For the conversion is necessary to have a data class (in this case User). We use while loop in this case. Every iteration we create a new object and insert data to them. After that we insert the object into an ArrayList. Direct conversion of ResultSet in ArrayList does not exist.
ArrayList = new ArrayList(); ResultSet rs = stmt.executeQuery("SELECT * FROM tblUsers"); while (rs.next()) { int id = rs.getInt("userid"); String name = rs.getString("username"); User user = new User(id, name); arrayList.add(user); }