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.
Working with JDBC
Select android info
Report a typo
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 ->
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.