数据库SQLite错误汇总

来源:互联网 发布:边标志扫描线填充算法 编辑:程序博客网 时间:2024/05/17 00:10

1.java.lang.IllegalArgumentException: Cannot bind argument at index 1 because the index is out of range. The statement has 0 parameters.

原代码(查询语句)
Cursor cursor = db.rawQuery("select * from message where user_name = '?' ", new String[]{currentUserName});
修改后(?这里去除了单引号)
Cursor cursor = db.rawQuery("select * from message where user_name = ? ", new String[]{currentUserName});
0 0
原创粉丝点击