本文整理了Java中com.healthmarketscience.jackcess.Table.updateRow()
方法的一些代码示例,展示了Table.updateRow()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.updateRow()
方法的具体详情如下:
包路径:com.healthmarketscience.jackcess.Table
类名称:Table
方法名:updateRow
[英]Update the given row. Provided Row must have previously been returned from this Table.
[中]
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
@Override
public Row updateRow(Row row) throws IOException {
return wrapped.updateRow(row);
}
代码示例来源:origin: stackoverflow.com
Table tbl = db.getTable(tableName);
Row row = CursorBuilder.findRowByPrimaryKey(tbl, 3); // i.e., ID = 3
if (row != null) {
// Note: column names are case-sensitive
row.put("Title", "The New Title For This Book");
tbl.updateRow(row);
}
代码示例来源:origin: com.healthmarketscience.jackcess/jackcess
@Override
public ComplexValue.Id updateRawValue(Row rawValue) throws IOException {
_flatTable.updateRow(rawValue);
return getValueId(rawValue);
}
代码示例来源:origin: stackoverflow.com
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);
}
代码示例来源:origin: stackoverflow.com
try (Database db = DatabaseBuilder.open(new File("C:/Users/Public/mdbTest.mdb"))) {
Table table = db.getTable("Members");
Row row = CursorBuilder.findRow(table, Collections.singletonMap("MemberID", 1));
if (row != null) {
row.put("SponsorID", "0"); // "Long Integer" in Access
row.put("FeePaid", "130"); // "Currency" in Access
table.updateRow(row);
}
else {
System.out.println("row not found.");
}
} catch (Exception e) {
e.printStackTrace(System.out);
}
代码示例来源:origin: stackoverflow.com
// open existing database
Database db = DatabaseBuilder.open(new File(
"C:/Users/Gord/Desktop/foo.accdb"));
String tempTableName = "TemporaryNameForTable";
// import CSV file into new table with temporary name
ImportUtil.Builder ib = new ImportUtil.Builder(db);
ib.setTableName(tempTableName);
ib.importFile(new File("C:/Users/Gord/Desktop/foo.csv"));
// rename the new table
Table mso = db.getSystemTable("MSysObjects");
Row r = CursorBuilder.findRow(mso,
Collections.singletonMap("Name", tempTableName));
r.put("Name", "type"); // new name is "type"
mso.updateRow(r);
db.close();
代码示例来源:origin: net.sf.ucanaccess/ucanaccess
for (Row row : t) {
row.put(cl.getName(), defObj);
t.updateRow(row);
内容来源于网络,如有侵权,请联系作者删除!