How do I use prepared statements in SQlite in Android?

前端 未结 5 579
無奈伤痛
無奈伤痛 2020-11-22 04:17

How do I use prepared statements in SQlite in Android?

5条回答
  •  醉话见心
    2020-11-22 04:58

    jasonhudgins example won't work. You can't execute a query with stmt.execute() and get a value (or a Cursor) back.

    You can only precompile statements that either returns no rows at all (such as an insert, or create table statement) or a single row and column, (and use simpleQueryForLong() or simpleQueryForString()).

提交回复
热议问题