Select android info

Report a typo

Luke Skywalker wants to have a list of androids from the androids table, so he uses a method called getAndroidsList to obtain the list. An android has an id and a name. Please put the code in order.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                val rs = stmt.executeQuery()
              
                val androids = mutableListOf<Android>()
              
                }
              
                androids.add(User(rs.getInt("id"), rs.getString("name")))
              
                }
              
                conn.prepareStatement(sql).use { stmt ->
              
                }
              
                while (rs.next()) {
              
                fun getAndroidsList(): List<Android> {
              
                }
              
                return androids
              
                val sql = """SELECT * FROM androids"""
              
                DatabaseManager.open().use { conn ->
              
___

Create a free account to access the full topic