com.healthmarketscience.jackcess.Table.updateRow()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(2.6k)|赞(0)|评价(0)|浏览(621)

本文整理了Java中com.healthmarketscience.jackcess.Table.updateRow()方法的一些代码示例,展示了Table.updateRow()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.updateRow()方法的具体详情如下:
包路径:com.healthmarketscience.jackcess.Table
类名称:Table
方法名:updateRow

Table.updateRow介绍

[英]Update the given row. Provided Row must have previously been returned from this Table.
[中]

代码示例

代码示例来源:origin: net.sf.ucanaccess/ucanaccess

  1. @Override
  2. public Row updateRow(Row row) throws IOException {
  3. return wrapped.updateRow(row);
  4. }

代码示例来源:origin: stackoverflow.com

  1. Table tbl = db.getTable(tableName);
  2. Row row = CursorBuilder.findRowByPrimaryKey(tbl, 3); // i.e., ID = 3
  3. if (row != null) {
  4. // Note: column names are case-sensitive
  5. row.put("Title", "The New Title For This Book");
  6. tbl.updateRow(row);
  7. }

代码示例来源:origin: com.healthmarketscience.jackcess/jackcess

  1. @Override
  2. public ComplexValue.Id updateRawValue(Row rawValue) throws IOException {
  3. _flatTable.updateRow(rawValue);
  4. return getValueId(rawValue);
  5. }

代码示例来源:origin: stackoverflow.com

  1. String dbFile = "C:/Users/Public/test/DB.mdb";
  2. try (Database db = DatabaseBuilder.open(new File(dbFile))) {
  3. Table table = db.getTable("Table1");
  4. Cursor cursor = CursorBuilder.createCursor(table);
  5. int testNum = 1;
  6. for (Row row : cursor.newIterable().addMatchPattern("testnum", testNum)) {
  7. row.put("active", true);
  8. table.updateRow(row);
  9. }
  10. } catch (Exception e) {
  11. e.printStackTrace(System.out);
  12. }

代码示例来源:origin: stackoverflow.com

  1. try (Database db = DatabaseBuilder.open(new File("C:/Users/Public/mdbTest.mdb"))) {
  2. Table table = db.getTable("Members");
  3. Row row = CursorBuilder.findRow(table, Collections.singletonMap("MemberID", 1));
  4. if (row != null) {
  5. row.put("SponsorID", "0"); // "Long Integer" in Access
  6. row.put("FeePaid", "130"); // "Currency" in Access
  7. table.updateRow(row);
  8. }
  9. else {
  10. System.out.println("row not found.");
  11. }
  12. } catch (Exception e) {
  13. e.printStackTrace(System.out);
  14. }

代码示例来源:origin: stackoverflow.com

  1. // open existing database
  2. Database db = DatabaseBuilder.open(new File(
  3. "C:/Users/Gord/Desktop/foo.accdb"));
  4. String tempTableName = "TemporaryNameForTable";
  5. // import CSV file into new table with temporary name
  6. ImportUtil.Builder ib = new ImportUtil.Builder(db);
  7. ib.setTableName(tempTableName);
  8. ib.importFile(new File("C:/Users/Gord/Desktop/foo.csv"));
  9. // rename the new table
  10. Table mso = db.getSystemTable("MSysObjects");
  11. Row r = CursorBuilder.findRow(mso,
  12. Collections.singletonMap("Name", tempTableName));
  13. r.put("Name", "type"); // new name is "type"
  14. mso.updateRow(r);
  15. db.close();

代码示例来源:origin: net.sf.ucanaccess/ucanaccess

  1. for (Row row : t) {
  2. row.put(cl.getName(), defObj);
  3. t.updateRow(row);

相关文章