0
テーブルを削除するために削除する必要がある行を見つけるためにJackcessを使用しようとするとカーソルfindFirstRow
はなぜ無効になりますか?getSystemTableとfindFirstRowを使用してJackcess経由でテーブルを削除できません
private static void deleteTable(Database db, String tableName) throws IOException {
Table table = db.getSystemTable(tableName);
if (table == null) {
return;
}
Cursor cursor = table.getDefaultCursor();
Map<String, Object> criteria = new HashMap<String, Object>();
criteria.put("Name", tableName);
criteria.put("Type", (short) 1);
if (cursor.findFirstRow(criteria)) {
table.deleteRow(cursor.getCurrentRow());
Log.e(TAG, "delete " + tableName + " success!");
} else {
Log.e(TAG, "can't find this Table");//run here
}
db.flush();
db.close();
}
p.s:いいえ報告例外
タイトルを使用する必要があります。質問の本文を使用して問題をより詳細に説明してください。それは、本文中のタイトルを繰り返すことを意味する場合は、タイトルを繰り返します。体内のコードだけの質問は通常低品質です。 –