Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/217.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android SQLITeAsselPer插入/删除/更新_Android_Sqlite - Fatal编程技术网

Android SQLITeAsselPer插入/删除/更新

Android SQLITeAsselPer插入/删除/更新,android,sqlite,Android,Sqlite,我正在考虑在我的应用程序中使用库。实际上,我知道如何从数据库中读取数据,但我不知道如何插入/删除/更新数据。 这可能吗? 谢谢你帮助我 与使用常规SQLiteOpenHelper的方法相同。使用getWritableDatabase()获取一个SQLiteDatabase对象,并对其执行CRUD操作 public Database open() throws SQLException{ ourHelper = new DbHelper(ourContext);

我正在考虑在我的应用程序中使用库。实际上,我知道如何从数据库中读取数据,但我不知道如何插入/删除/更新数据。
这可能吗?

谢谢你帮助我

与使用常规
SQLiteOpenHelper
的方法相同。使用
getWritableDatabase()
获取一个
SQLiteDatabase
对象,并对其执行CRUD操作

    public Database open() throws SQLException{
        ourHelper = new DbHelper(ourContext);
        ourDatabase = ourHelper.getWritableDatabase();
        return this;        
    }

   public void close() {
        ourHelper.close();
   }



    public long createEntry(String product, String kcal, String eenheid) {
        ContentValues cv = new ContentValues();
        cv.put(FEILD1, field1);
        cv.put(FEILD2, field2);
        cv.put(FEILD13, field3);
        return ourDatabase.insert(DATABASE_TABLE, null, cv);

    }