zoukankan      html  css  js  c++  java
  • 每日日报2021 6/9

    今天我检查了 查询操作的基本想法。

    public Person find(Integer id)
    {
        SQLiteDatabase db = dbOpenHelper.getReadableDatabase();
        Cursor cursor =  db.rawQuery("SELECT * FROM person WHERE personid = ?",
                new String[]{id.toString()});
        //存在数据才返回true
        if(cursor.moveToFirst())
        {
            int personid = cursor.getInt(cursor.getColumnIndex("personid"));
            String name = cursor.getString(cursor.getColumnIndex("name"));
            String phone = cursor.getString(cursor.getColumnIndex("phone"));
            return new Person(personid,name,phone);
        }
        cursor.close();
        return null;
    }
  • 相关阅读:
    美化博客园
    ansible的安装
    面向对象和类
    函数知识分类
    生成器
    内置函数_old
    迭代器
    装饰器
    Hadoop——MapReduce
    Hadoop——HDFS
  • 原文地址:https://www.cnblogs.com/song-1/p/14947770.html
Copyright © 2011-2022 走看看