Prepared statement

Report a typo

Write the missing call to return a prepared statement for the insert variable.

class PersonStore(private val db: SQLiteDatabase) : Closeable {
    private val insert = db.________(
        "INSERT INTO people (name, birth) VALUES (?, ?)"
    )

    fun insert(name: String, birth: LocalDate): Long {
        insert.bindString(1, name)
        insert.bindLong(2, birth.toEpochDay())
        return insert.executeInsert()
    }

    override fun close() {
        insert.close()
    }
}
Enter a short text
___

Create a free account to access the full topic