How delete row from table with help jackcess? I try so, but it's bad:
Table ptabl = db.getTable("person"); int pcount = ptabl.getRowCount(); for (int i = 0; i < pcount; i++) { Map<String, Object> row2 = ptabl.getNextRow(); if (row2.get("id") == Integer.valueOf(1)) { ptabl.deleteCurrentRow(); } }
How set column "id" attribute to autoincrement?
Table newTable = new TableBuilder("diagnosis"). addColumn(new ColumnBuilder("id") .setSQLType(Types.INTEGER) .toColumn()) .addColumn(new ColumnBuilder("name") .setSQLType(Types.VARCHAR) .toColumn()).toTable(db);
相关问题
- Delete Messages from a Topic in Apache Kafka
- Jackson Deserialization not calling deserialize on
- How to maintain order of key-value in DataFrame sa
- StackExchange API - Deserialize Date in JSON Respo
- Difference between Types.INTEGER and Types.NULL in
If your id column is indexed, you can use an IndexCursor to quickly find columns:
If your id column is not indexed, you can use a normal cursor, which is more convenient but effectively no faster than your current code (just does a table scan):
And your own answer indicates you already figured out how to make a column auto increment.
For set autoincrement to column: