ConnectorLib Java 24.4
ConnectorLib Java SDK Programming Guide

# Update Records

To update records in a table, use the `recordUpdate` method of the `Datastore` class. This method updates all records that match a filter. You can update all of the columns for the record, or just some of them.

In Create Tables, a table was introduced that stored a reference and a last modified date. This sample code updates a single record in that table:

           DatastoreRecord filter = new DatastoreRecord();
           filter.setString("Reference", "C:\\data\\file1.txt");

           DatastoreRecord update = new DatastoreRecord();
           update.setString("LastModified", "2014/12/28 17:21:07");

           datastore.recordUpdate("Documents", filter, update);

The first argument specifies which table to update. The second argument is a filter that selects all records with the given reference. The third argument is a record. Any fields set in this record are set in matching records in the table, while any fields that are not set are ignored. In the example above, only the “LastModified” field is set, so that is updated and the Reference is not changed.

Copyright 2024 Open Text
Version 24.4 | Last updated September 2024

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to MFI-swpdl.idoldocsfeedback@opentext.com.

We appreciate your feedback!

Product: IDOL ConnectorLib Java 24.4

Topic Title: Update Records