Html code
- Android 2.3.3
- Eclipse Version: 3.7.0
- LogCat
LogCat error message:
Java code
- 02-13 09:21:35.030: WARN/dalvikvm (17173): Threadid =19: Thread exiting with uncaught exception (group =Zero x 40015560)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): Fatal exception: Thread-26
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): Android. database. sqlite. SQLiteException: bind or column index out of range: handle0x309b08
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteProgram. native_bind_string (Native Method)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteProgram. bindString (SQLiteProgram. java:244)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteQuery. bindString (SQLiteQuery. java:185)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteDirectCursorDriver. query (SQLiteDirectCursorDriver. java:48)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteDatabase. rawQueryWithFactory (SQLiteDatabase. java:1356)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteDatabase. queryWithFactory (SQLiteDatabase. java:1235)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteDatabase. query (SQLiteDatabase. java:1189)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At android. database. sqlite. SQLiteDatabase. query (SQLiteDatabase. java:1271)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At com. tmall. nokia. db. RecordDBHelper. query (RecordDBHelper. java:50)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At com. tmall. nokia. manage. RecordDBopt. get (RecordDBopt. java:78)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At com. tmall. nokia. manage. RecordMessage. sendMseeage (RecordMessage. java:111)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At com. tmall. nokia. manage. RecordMessage. sendMseeage (RecordMessage. java:87)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At com. tmall. nokia. Report. run (Report. java:49)
- 02-13 09:21:35.130: ERROR/AndroidRuntime (17173): At java. lang. Thread. run (Thread. java:1019)
- 02-13 09:21:35.200: WARN/ActivityManager (62): Force finishing activity com. tmall. nokia/. Iphone
Cause analysis:
Here at com. tmall. nokia. db. RecordDBHelper. query (RecordDBHelper. java: 50) has a problem:
Java code
- Cursor cur = db. query (TBL_NAME,Null, Where, args,Null,Null, Order );
Follow the error Log prompt to continue searching for the error location. It is found that the length of the input parameter where is different from that of the args array. Therefore, the error "android. database. sqlite. SQLiteException: bind or column index out of range" is reported (the bound or column index is out of the range ).
Solution:
After finding the cause of the error, modify the input parameter to ensure that the where parameter is consistent with the args length.