The query(), exec() and rawQuery() methods in the SQLiteDatabase allow binding only Strings to parameters. How do I bind parameters that are not Strings. Specifically, I would like to execute a statement whose where clause contains a parameter that is a (small) blob. How do I bind such values
Thank you.
Convert your type to
Stringbefore passing it to any of the methods.To convert an int, use the static method
Integer.toString(int). Similarly, to convert a long, use the static methodLong.toString(long).In case of
byte[]you can use theString(byte[])orString(byte[], Charset)constructor. You will need to ensure that you use appropriate and consistent encoding.