java - 我想在 Android Studio 中从我的 SQLite 数据库中删除一些东西
问题描述
嘿,我想用一个按钮从我的数据库中删除一些东西。但是当我按下按钮时,这个错误来了:
12-20 14:25:27.897 19233-19233/com.example.corona_anwesenheitsliste W/System: ClassLoader referenced unknown path: /data/app/com.example.corona_anwesenheitsliste-1/lib/arm64
12-20 14:25:27.951 19233-19233/com.example.corona_anwesenheitsliste W/art: Before Android 4.1, method android.graphics.PorterDuffColorFilter
androidx.vectordrawable.graphics.drawable.VectorDrawableCompat.updateTintFilter(android.graphics.PorterDuffColorFilter, android.content.res.ColorStateList, android.graphics.PorterDuff$Mode) would have incorrectly overridden the package-private method in android.graphics.drawable.Drawable
12-20 14:25:27.992 19233-19233/com.example.corona_anwesenheitsliste I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
12-20 14:25:27.992 19233-19233/com.example.corona_anwesenheitsliste I/art: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$2>
12-20 14:25:28.057 19233-19233/com.example.corona_anwesenheitsliste I/HwSecImmHelper: mSecurityInputMethodService is null
12-20 14:25:28.066 19233-19233/com.example.corona_anwesenheitsliste E/HAL: load: id=gralloc != hmi->id=gralloc
12-20 14:25:28.091 19233-19252/com.example.corona_anwesenheitsliste E/HAL: load: id=gralloc != hmi->id=gralloc
12-20 14:25:28.092 19233-19252/com.example.corona_anwesenheitsliste I/OpenGLRenderer: Initialized EGL, version 1.4
12-20 14:25:28.096 19233-19252/com.example.corona_anwesenheitsliste W/OpenGLRenderer: load: so=/system/lib64/libhwuibp.so
dlopen failed: library "/system/lib64/libhwuibp.so" not found
12-20 14:25:28.096 19233-19252/com.example.corona_anwesenheitsliste W/OpenGLRenderer: Initialize Binary Program Cache: Load Failed
12-20 14:25:28.097 19233-19252/com.example.corona_anwesenheitsliste E/HAL: load: id=gralloc != hmi->id=gralloc
12-20 14:25:28.177 19233-19233/com.example.corona_anwesenheitsliste I/HwSecImmHelper: mSecurityInputMethodService is null
12-20 14:25:28.178 19233-19233/com.example.corona_anwesenheitsliste I/HwSecImmHelper: mSecurityInputMethodService is null
这是“删除方法”的代码:
public void deleteName(int id, String name) {
SQLiteDatabase db = this.getWritableDatabase();
String query = "DELETE FROM " + TABLE_NAME + " WHERE "
+ COL1 + " = '" + id + "'" +
"NAME" + COL2 + " = '" + name + "'" ;
Log.d(TAG, "deleteID: query: " + query);
Log.d(TAG, "deleteName: Deleting " + name + " from database");
db.execSQL(query);
}
什么是正确的删除语句?
解决方案
推荐阅读
- maven - 黄瓜选项未从 mvn cli 命令运行标记场景
- r - R,错误:$ 运算符对 fastai 中的原子向量无效
- postgresql - 为什么一段时间后运行查询时,seq/index 扫描需要这么长时间?如何让它快速?
- c# - 各种bool的机器码区别是什么?查询?
- client-server - 标准代理注册协议
- php - 警告:mysqli_connect(): (HY000/2002): No such file or directory in
- video - 如何从gstreamer中的流式视频中删除随机灰色帧
- sql-server - Apache Kafka 中的 IDENTITY_INSERT 问题 - JDBC - MSSQL
- python - 我如何在 tkinter 中创建一组带有循环的按钮?
- excel - 远程文件中的相对 URL (XLS)