该功能的代码实现:
Workspace mWorkspace=new Workspace();
DatasourceConnectionInfo info=new DatasourceConnectionInfo();
info.setEngineType(EngineType.UDB);
info.setServer("data/Changchun.udb");
Datasource mDatasource=mWorkspace.getDatasources().open(info);
DatasetVector vector=(DatasetVector) mDatasource.getDatasets().get("test");
Recordset mRecordset=vector.getRecordset(false, CursorType.DYNAMIC);
Map<String, Object> values=new HashMap<>();
values.put("SmUserID", 1);
boolean isOK=mRecordset.addNew(null,values);
System.out.println(isOK);
mRecordset.update();
int count=mRecordset.getRecordCount();
System.out.println(count);