The following code works for me:
String dbFile = "C:/Users/Public/test/DB.mdb";
try (Database db = DatabaseBuilder.open(new File(dbFile))) {
Table table = db.getTable("Table1");
Cursor cursor = CursorBuilder.createCursor(table);
int testNum = 1;
for (Row row : cursor.newIterable().addMatchPattern("testnum", testNum)) {
row.put("active", true);
table.updateRow(row);
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
Note that column names are case sensitive when working with Jackcess. The above code updates the column with the name active, so
row.put("active", true);
table.updateRow(row);
works but
row.put("active", true);
table.updateRow(row);
will not work.
source
share