Does cursor.getString () force an int into a string?

The docs say:

The result and this method throws an exception if the column value is null or the column type is not a string type. from implementation.

What kind of implementation are they talking about? Sqlite version? Will call

cursor.getString(INT_COLUMN)

force value intto String?

+5
source share
1 answer

Does cursor.getString () support forcing an int into a string?

Yes, the same data from your tables can be returned using the getString(), getInt(), getLong(), and so on, if that makes sense. For instance,

  • If the column data is 42: getInt()returns 42, and getString()returns "42".
  • : getString() "plant", getInt() 0.
+17

All Articles