简单的数据库操作问题。
数据库中,一共有flag、test1、test2这3列,我想取flag=1时,test1、test2的值。
帮忙看下,这sql为什么没找到数据啊?
Cursor cursor = baseDao.query("downloading", null, "flag=1", null);
if(null != cursor){
while(cursor.moveToNext()){
test1= cursor.getInt(cursor.getColumnIndex("test1"));
System.out.println("test1==>"+test1);
test2= cursor.getInt(cursor.getColumnIndex("test2"));
System.out.println("test2==>"+test2); }
}
[解决办法]
楼主可以看看这篇文章http://blog.csdn.net/xiaanming/article/details/8679521
顺便帮自己拉拉票http://vote.blog.csdn.net/blogstaritem/blogstar2013/xiaanming